Skip to content

Commit

Permalink
Update java/src/main/native/include/jni_utils.hpp
Browse files Browse the repository at this point in the history
Co-authored-by: Jason Lowe <[email protected]>
  • Loading branch information
sperlingxx and jlowe authored Apr 22, 2022
1 parent 907c67e commit e313a2a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions java/src/main/native/include/jni_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,18 +816,15 @@ inline void jni_cuda_check(JNIEnv *const env, cudaError_t cuda_status) {
jstring j_msg = env->NewStringUTF(n_msg.c_str()); \
jint e_code = static_cast<jint>(e.error_code()); \
jclass ex_class = env->FindClass(class_name); \
if (ex_class == NULL) { \
return ret_val; \
} \
jmethodID ctor_id = env->GetMethodID(ex_class, "<init>", "(Ljava/lang/String;I)V"); \
if (ctor_id == NULL) { \
return ret_val; \
} \
jobject cuda_error = env->NewObject(ex_class, ctor_id, j_msg, e_code); \
if (cuda_error == NULL) { \
return ret_val; \
} \
env->Throw((jthrowable)cuda_error); \
if (ex_class != NULL) { \
jmethodID ctor_id = env->GetMethodID(ex_class, "<init>", "(Ljava/lang/String;I)V"); \
if (ctor_id != NULL) { \
jobject cuda_error = env->NewObject(ex_class, ctor_id, j_msg, e_code); \
if (cuda_error != NULL) { \
env->Throw((jthrowable)cuda_error); \
} \
} \
} \
return ret_val; \
}

Expand Down

0 comments on commit e313a2a

Please sign in to comment.