Skip to content

Commit 8644396

Browse files
committed
[CUDA][HIP] Cleanup KERNEL_NAMES property
No need to keep an empty function, it can always be added if we need it in the future.
1 parent cf52459 commit 8644396

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

source/adapters/cuda/program.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,6 @@ ur_result_t ur_program_handle_t_::getGlobalVariablePointer(
176176
return UR_RESULT_SUCCESS;
177177
}
178178

179-
/// Finds kernel names by searching for entry points in the PTX source, as the
180-
/// CUDA driver API doesn't expose an operation for this.
181-
/// Note: This is currently only being used by the SYCL program class for the
182-
/// has_kernel method, so an alternative would be to move the has_kernel
183-
/// query to UR and use cuModuleGetFunction to check for a kernel.
184-
/// Note: Another alternative is to add kernel names as metadata, like with
185-
/// reqd_work_group_size.
186-
ur_result_t getKernelNames(ur_program_handle_t) {
187-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
188-
}
189-
190179
/// Loads images from a list of PTX or CUBIN binaries.
191180
/// Note: No calls to CUDA driver API in this function, only store binaries
192181
/// for later.
@@ -421,8 +410,9 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
421410
case UR_PROGRAM_INFO_BINARIES:
422411
return ReturnValue(&hProgram->Binary, 1);
423412
case UR_PROGRAM_INFO_KERNEL_NAMES:
424-
/* TODO: Add implementation for getKernelNames */
425-
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
413+
// CUDA has no way to query a list of kernels from a binary.
414+
// In SYCL this is only used in kernel bundle when building from source
415+
// which isn't currently supported for CUDA.
426416
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
427417
case UR_PROGRAM_INFO_NUM_KERNELS:
428418
case UR_PROGRAM_INFO_IL:

source/adapters/hip/program.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,6 @@ ur_result_t ur_program_handle_t_::getGlobalVariablePointer(
259259
return UR_RESULT_SUCCESS;
260260
}
261261

262-
/// Finds kernel names by searching for entry points in the PTX source, as the
263-
/// HIP driver API doesn't expose an operation for this.
264-
/// Note: This is currently only being used by the SYCL program class for the
265-
/// has_kernel method, so an alternative would be to move the has_kernel
266-
/// query to UR and use hipModuleGetFunction to check for a kernel.
267-
ur_result_t getKernelNames(ur_program_handle_t) {
268-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
269-
}
270-
271262
/// A program must be specific to a device so this entry point is UNSUPPORTED
272263
UR_APIEXPORT ur_result_t UR_APICALL
273264
urProgramCreateWithIL(ur_context_handle_t, const void *, size_t,
@@ -408,8 +399,9 @@ urProgramGetInfo(ur_program_handle_t hProgram, ur_program_info_t propName,
408399
case UR_PROGRAM_INFO_BINARIES:
409400
return ReturnValue(&hProgram->Binary, 1);
410401
case UR_PROGRAM_INFO_KERNEL_NAMES:
411-
/* TODO: Add implementation for getKernelNames */
412-
UR_ASSERT(getKernelNames(hProgram), UR_RESULT_ERROR_UNSUPPORTED_FEATURE);
402+
// HIP has no way to query a list of kernels from a binary.
403+
// In SYCL this is only used in kernel bundle when building from source
404+
// which isn't currently supported for HIP.
413405
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
414406
case UR_PROGRAM_INFO_NUM_KERNELS:
415407
case UR_PROGRAM_INFO_IL:

0 commit comments

Comments
 (0)