Skip to content

Commit

Permalink
Merge branch 'develop' into release/1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
jjfumero committed May 28, 2024
2 parents 404f924 + 14b81db commit 315aea7
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ JNIEXPORT jlong JNICALL Java_uk_ac_manchester_tornado_drivers_spirv_ocl_SPIRVOCL
#else
cl_context context = reinterpret_cast<cl_context>(contextPointer);
jbyte* spirv = env->GetByteArrayElements(spirvBinary, 0);
long* length = env->GetLongArrayElements(spirvArrayLength, 0);
jlong* length = env->GetLongArrayElements(spirvArrayLength, 0);
cl_int status;
cl_program programPointer = clCreateProgramWithIL(context, spirv , length[0], &status);
LOG_OCL_AND_VALIDATE("clCreateProgramWithIL", status);

int statusArray[1];
jint* statusArray = static_cast<jint *>(malloc(sizeof(jint)));
statusArray[0] = status;
env->SetIntArrayRegion(errorCodeArray, 0, 1, statusArray);

Expand Down Expand Up @@ -90,7 +90,7 @@ JNIEXPORT jlong JNICALL Java_uk_ac_manchester_tornado_drivers_spirv_ocl_SPIRVOCL
const char *kernelNameC = env->GetStringUTFChars(kernelName, NULL);
cl_int status;
cl_kernel kernel = clCreateKernel((cl_program) programPointer,kernelNameC, &status);
int statusArray[1];
jint* statusArray = static_cast<jint *>(malloc(sizeof(jint)));
statusArray[0] = status;
env->SetIntArrayRegion(errorCode, 0, 1, statusArray);
env->ReleaseStringUTFChars(kernelName, kernelNameC);
Expand Down Expand Up @@ -164,8 +164,8 @@ JNIEXPORT jint JNICALL Java_uk_ac_manchester_tornado_drivers_spirv_ocl_SPIRVOCLN
}

if (kernelEventArray != nullptr) {
long kernelEventNative[1];
kernelEventNative[0] = reinterpret_cast<long>(kernelEvent);
jlong* kernelEventNative = static_cast<jlong *>(malloc(sizeof(jlong)));
kernelEventNative[0] = reinterpret_cast<jlong>(kernelEvent);
env->SetLongArrayRegion(kernelEventArray, 0, 1, kernelEventNative);
}
return status;
Expand Down

0 comments on commit 315aea7

Please sign in to comment.