- Question: does float3 support addition etc.
float3 is is among others mentioned as “built in vector type”. Is it possible to write something like
int main ()
float3 px = make_float3(1.0,2.0,3.0); float3 px2 = make_float3(1.0,2.0,3.0); float3 px3 = px + px2;
when i do so i get the following error report:
float3> nvcc float3.cu
float3.cu(53): error: no operator “+” matches these operands
operand types are: float3 + float3
1 error detected in the compilation of “/tmp/tmpxft_000014bf_00000000-4_float3.cpp1.ii”.
do you have to include something, did i make a mistake, or is it simply not possible?
If 1. Question is answered with yes, and float3 supports some basic operations, were can i get details, for example a wjole list of them an how do they work exactly.
If 1. Question is answered with yes, does float3 + float3 differ in speed from
with vecAdd is something like
device void vecAdd(float* a, float* b, float* out)
int i = threadIdx.x; out[i] = a[i]+b[i];
Thanks to everybody taking his/her precious time to answer these rookie questions!
Linux suse 11.1
GPU: GTX 275
Intel E6600@ 2GB RAM