/* * Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is * holder of all proprietary rights on this computer program. * You can only use this computer program if you have closed * a license agreement with MPG or you get the right to use the computer * program from someone who is authorized to grant you that right. * Any use of the computer program without a valid license is prohibited and * liable to prosecution. * * Copyright©2019 Max-Planck-Gesellschaft zur Förderung * der Wissenschaften e.V. (MPG). acting on behalf of its Max Planck Institute * for Intelligent Systems. All rights reserved. * * @author Vasileios Choutas * Contact: vassilis.choutas@tuebingen.mpg.de * Contact: ps-license@tuebingen.mpg.de * */ #ifndef DEFINITIONS_H #define DEFINITIONS_H #include #include "device_launch_parameters.h" #include template using vec3 = typename std::conditional::value, float3, double3>::type; template using vec2 = typename std::conditional::value, float2, double2>::type; float3 make_float3(double3 vec) { return make_float3(vec.x, vec.y, vec.z); } float3 make_float3(double x, double y, double z) { return make_float3(x, y, z); } double3 make_double3(float3 vec) { return make_double3(vec.x, vec.y, vec.z); } double3 make_double3(float x, float y, float z) { return make_double3(x, y, z); } template __host__ __device__ vec3 make_vec3(T x, T y, T z) { } template <> __host__ __device__ vec3 make_vec3(float x, float y, float z) { return make_float3(static_cast(x), static_cast(y), static_cast(z)); } template <> __host__ __device__ vec3 make_vec3(double x, double y, double z) { return make_double3(static_cast(x), static_cast(y), static_cast(z)); } #endif // ifndef DEFINITIONS_H