Skip to content

Commit

Permalink
Merge pull request #1302 from kbenzie/benie/cl-binary-type-intermediate
Browse files Browse the repository at this point in the history
[CL] Handle INTERMEDIATE binary type
  • Loading branch information
kbenzie authored Feb 1, 2024
2 parents 553a6b8 + 5e51373 commit 9363574
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions source/adapters/opencl/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ static cl_int mapURProgramBuildInfoToCL(ur_program_build_info_t URPropName) {
static ur_program_binary_type_t
mapCLBinaryTypeToUR(cl_program_binary_type binaryType) {
switch (binaryType) {
default:
// If we don't understand what OpenCL gave us, return NONE.
// TODO: Emit a warning to the user.
[[fallthrough]];
case CL_PROGRAM_BINARY_TYPE_INTERMEDIATE:
// The INTERMEDIATE binary type is defined by the cl_khr_spir extension
// which we shouldn't encounter but do. Semantically this binary type is
// equivelent to NONE as they both require compilation.
[[fallthrough]];
case CL_PROGRAM_BINARY_TYPE_NONE:
return UR_PROGRAM_BINARY_TYPE_NONE;
case CL_PROGRAM_BINARY_TYPE_COMPILED_OBJECT:
Expand All @@ -267,8 +276,6 @@ mapCLBinaryTypeToUR(cl_program_binary_type binaryType) {
return UR_PROGRAM_BINARY_TYPE_LIBRARY;
case CL_PROGRAM_BINARY_TYPE_EXECUTABLE:
return UR_PROGRAM_BINARY_TYPE_EXECUTABLE;
default:
return UR_PROGRAM_BINARY_TYPE_FORCE_UINT32;
}
}

Expand Down

0 comments on commit 9363574

Please sign in to comment.