File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,6 +192,19 @@ class BSDRnd : public LCGRnd
192192 __host__ __device__ int rnd () { return LCGRnd::rnd (); }
193193};
194194
195+
196+ // CUDA does not support <type4> operations:
197+ // https://forums.developer.nvidia.com/t/swizzling-float4-arithmetic-support/217
198+ #ifndef __HIPCC__
199+ inline __host__ __device__ void operator +=(int4 &a, int4 b)
200+ {
201+ a.x += b.x ;
202+ a.y += b.y ;
203+ a.z += b.z ;
204+ a.w += b.w ;
205+ }
206+ #endif
207+
195208namespace o2
196209{
197210namespace benchmark
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ __global__ void read_k(
4949{
5050 chunk_t sink{0 };
5151 for (size_t i = blockIdx .x * blockDim .x + threadIdx .x ; i < chunkSize; i += blockDim .x * gridDim .x ) {
52- sink = chunkPtr[i] + sink ;
52+ sink + = chunkPtr[i];
5353 }
5454 chunkPtr[threadIdx .x ] = sink;
5555}
You can’t perform that action at this time.
0 commit comments