mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2024-11-24 18:59:16 +08:00
Permit negation of const vectors
This commit is contained in:
parent
e8568c4173
commit
4b1236548a
|
@ -263,27 +263,27 @@ inline __host__ __device__ uint4 make_uint4(int4 a)
|
||||||
// negate
|
// negate
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
inline __host__ __device__ float2 operator-(float2 &a)
|
inline __host__ __device__ float2 operator-(float2 a)
|
||||||
{
|
{
|
||||||
return make_float2(-a.x, -a.y);
|
return make_float2(-a.x, -a.y);
|
||||||
}
|
}
|
||||||
inline __host__ __device__ int2 operator-(int2 &a)
|
inline __host__ __device__ int2 operator-(int2 a)
|
||||||
{
|
{
|
||||||
return make_int2(-a.x, -a.y);
|
return make_int2(-a.x, -a.y);
|
||||||
}
|
}
|
||||||
inline __host__ __device__ float3 operator-(float3 &a)
|
inline __host__ __device__ float3 operator-(float3 a)
|
||||||
{
|
{
|
||||||
return make_float3(-a.x, -a.y, -a.z);
|
return make_float3(-a.x, -a.y, -a.z);
|
||||||
}
|
}
|
||||||
inline __host__ __device__ int3 operator-(int3 &a)
|
inline __host__ __device__ int3 operator-(int3 a)
|
||||||
{
|
{
|
||||||
return make_int3(-a.x, -a.y, -a.z);
|
return make_int3(-a.x, -a.y, -a.z);
|
||||||
}
|
}
|
||||||
inline __host__ __device__ float4 operator-(float4 &a)
|
inline __host__ __device__ float4 operator-(float4 a)
|
||||||
{
|
{
|
||||||
return make_float4(-a.x, -a.y, -a.z, -a.w);
|
return make_float4(-a.x, -a.y, -a.z, -a.w);
|
||||||
}
|
}
|
||||||
inline __host__ __device__ int4 operator-(int4 &a)
|
inline __host__ __device__ int4 operator-(int4 a)
|
||||||
{
|
{
|
||||||
return make_int4(-a.x, -a.y, -a.z, -a.w);
|
return make_int4(-a.x, -a.y, -a.z, -a.w);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user