Introduce DOT built-in function.
takagi opened this issue · comments
We introduce DOT built-in function for the dot product operation for vector types to implement nbody sample code #4 .
For example, the dot product of two float3
vectors a = (a1, a2, a3) and b = (b1, b2, b3) is defined as:
(dot a b) = (+ (* a1 b1) (* a2 b2) (* a3 b3))
We provide the DOT built-in function for the following vector types:
- int2
- int3
- int4
- float2
- float3
- float4
- double2
- double3
- double4
We need to add related definitions in the following layers:
- Lisp built-in table
- CUDA built-in table
- CL-TUPLES operators
- CL-CUDA kernel functions