Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SIMD intrinsics - are they usable on gpus?

I'm wondering if I can use SIMD intrinsics in a GPU code like a CUDA's kernel or openCL one. Is that possible?

like image 990
Johnny Pauling Avatar asked Dec 05 '25 06:12

Johnny Pauling


2 Answers

No, SIMD intrinsics are just tiny wrappers for ASM code. They are CPU specific. More about them here.

Generally speking, why whould you do that? CUDA and OpenCL already contain many "functions" which are actually "GPU intrinsics" (all of these, for example, are single-point-math intrinsics for the GPU)

like image 102
Lorenzo Dematté Avatar answered Dec 07 '25 01:12

Lorenzo Dematté


You use the vector data types built into the OpenCL C language. For example float4 or float8. If you run with the Intel or AMD device drivers these should get converted to SSE/AVX instructions of the vendor's OpenCL device driver. OpenCL includes several functions such as dot(v1, v2) which should use the SSE/AVX dot production instructions. Is there a particular intrinsic you are interested in that you don't think you can get from the OpenCL C language?