@@ -114,7 +114,7 @@ public final void close() {
114
114
double reduceArray (double [] input ) {
115
115
var inputClBuffer = clCreateBuffer (
116
116
ctx , CL_MEM_COPY_HOST_PTR | CL_MEM_READ_ONLY | CL_MEM_HOST_NO_ACCESS ,
117
- input .length * Sizeof .cl_double , Pointer .to (input ), null );
117
+ ( long ) input .length * Sizeof .cl_double , Pointer .to (input ), null );
118
118
return reduceRecursively (inputClBuffer , input .length );
119
119
}
120
120
@@ -178,17 +178,18 @@ cl_mem reduceOnGpu(cl_mem input, int inputLength, int numberOfGroups, int groupS
178
178
var hostAccessMode = CL_MEM_HOST_NO_ACCESS ;
179
179
if (numberOfGroups == 1 ) hostAccessMode = CL_MEM_HOST_READ_ONLY ;
180
180
var results = clCreateBuffer (ctx , CL_MEM_READ_WRITE | hostAccessMode ,
181
- numberOfGroups * Sizeof .cl_double , null , null );
181
+ ( long ) numberOfGroups * Sizeof .cl_double , null , null );
182
182
183
183
try {
184
184
// set args and call kernel
185
185
clSetKernelArg (kernel , 0 /*input*/ , Sizeof .cl_mem , Pointer .to (input ));
186
186
clSetKernelArg (kernel , 1 /*inputLength*/ , Sizeof .cl_int ,
187
187
Pointer .to (new int [] {inputLength }));
188
- clSetKernelArg (kernel , 2 /*localSlice*/ , Sizeof .cl_double * groupSize , null );
188
+ clSetKernelArg (kernel , 2 /*localSlice*/ , ( long ) Sizeof .cl_double * groupSize , null );
189
189
clSetKernelArg (kernel , 3 /*results*/ , Sizeof .cl_mem , Pointer .to (results ));
190
- clEnqueueNDRangeKernel (queue , kernel , 1 , null , new long [] {numberOfGroups *groupSize },
191
- new long [] {groupSize }, 0 , null ,null );
190
+ clEnqueueNDRangeKernel (queue , kernel , 1 , null ,
191
+ new long [] {(long ) numberOfGroups * groupSize }, new long [] {groupSize },
192
+ 0 , null ,null );
192
193
return results ;
193
194
} catch (Throwable t ) {
194
195
clReleaseMemObject (results );
@@ -239,8 +240,8 @@ static synchronized void init() {
239
240
clGetDeviceInfo (device , CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS , Sizeof .cl_uint ,
240
241
Pointer .to (dimensionsBuffer ), null );
241
242
long [] maxSizes = new long [dimensionsBuffer [0 ]];
242
- clGetDeviceInfo (device , CL_DEVICE_MAX_WORK_ITEM_SIZES , Sizeof . size_t * dimensionsBuffer [ 0 ],
243
- Pointer .to (maxSizes ), null );
243
+ clGetDeviceInfo (device , CL_DEVICE_MAX_WORK_ITEM_SIZES ,
244
+ ( long ) Sizeof . size_t * dimensionsBuffer [ 0 ], Pointer .to (maxSizes ), null );
244
245
maxDimensionSize = (int ) maxSizes [0 ];
245
246
246
247
// get device SIMD width: jocl does not have binding for clGetKernelSubGroupInfo(...)
0 commit comments