Joseph Huber 51e3c3d51b
[Offload] Implement 'olIsValidBinary' in offload and clean up (#159658)
Summary:
This exposes the 'isDeviceCompatible' routine for checking if a binary
*can* be loaded. This is useful if people don't want to consume errors
everywhere when figuring out which image to put to what device.

I don't know if this is a good name, I was thining like `olIsCompatible`
or whatever. Let me know what you think.

Long term I'd like to be able to do something similar to what OpenMP
does where we can conditionally only initialize devices if we need them.
That's going to be support needed if we want this to be more
generic.
2025-09-19 12:15:57 -05:00

54 lines
1.4 KiB
CMake

set(PLUGINS_TEST_COMMON LLVMOffload)
set(PLUGINS_TEST_INCLUDE ${LIBOMPTARGET_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/common)
add_subdirectory(device_code)
add_offload_unittest("device"
device/olIterateDevices.cpp
device/olGetDeviceInfo.cpp
device/olGetDeviceInfoSize.cpp)
add_offload_unittest("event"
event/olCreateEvent.cpp
event/olDestroyEvent.cpp
event/olSyncEvent.cpp
event/olGetEventInfo.cpp
event/olGetEventInfoSize.cpp)
add_offload_unittest("init"
init/olInit.cpp)
target_compile_definitions("init.unittests" PRIVATE DISABLE_WRAPPER)
add_offload_unittest("kernel"
kernel/olCalculateOptimalOccupancy.cpp
kernel/olLaunchKernel.cpp)
add_offload_unittest("memory"
memory/olMemAlloc.cpp
memory/olMemFill.cpp
memory/olMemFree.cpp
memory/olMemcpy.cpp)
add_offload_unittest("platform"
platform/olGetPlatformInfo.cpp
platform/olGetPlatformInfoSize.cpp)
add_offload_unittest("program"
program/olCreateProgram.cpp
program/olIsValidBinary.cpp
program/olDestroyProgram.cpp)
add_offload_unittest("queue"
queue/olCreateQueue.cpp
queue/olSyncQueue.cpp
queue/olDestroyQueue.cpp
queue/olGetQueueInfo.cpp
queue/olGetQueueInfoSize.cpp
queue/olWaitEvents.cpp
queue/olLaunchHostFunction.cpp)
add_offload_unittest("symbol"
symbol/olGetSymbol.cpp
symbol/olGetSymbolInfo.cpp
symbol/olGetSymbolInfoSize.cpp)