30.07.2015 Views

Slides - Par Lab

Slides - Par Lab

Slides - Par Lab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Custom Types & Operatorsstruct negate_float2{__host__ __device__float2 operator()(float2 a){return make_float2(-a.x, -a.y);}};// declare storagedevice_vector input = ...device_vector output = ...// create function object or functornegate_float2 func;// negate vectorstransform(input.begin(), input.end(), output.begin(), func);© 2011 NVIDIA Corporation 55/73

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!