Skip to content

Commit

Permalink
Merge pull request #287 from coldav/colin/remove_ca_force_profile
Browse files Browse the repository at this point in the history
Remove CA_CL_FORCE_PROFILE
  • Loading branch information
coldav authored Jan 9, 2024
2 parents 400c4cb + efc890b commit 309776d
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 35 deletions.
5 changes: 0 additions & 5 deletions modules/compiler/utils/source/replace_mux_math_decls_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ PreservedAnalyses compiler::utils::ReplaceMuxMathDeclsPass::run(
(0 == (DI.half_capabilities & device_floating_point_capabilities_full));
}

#ifdef CA_CL_FORCE_PROFILE_STRING
is_embedded_profile =
cargo::string_view(CA_CL_FORCE_PROFILE_STRING) == "EMBEDDED_PROFILE";
#endif

const std::array<std::pair<StringRef, const bool>, 3> MuxMathDecls = {
std::make_pair(MuxBuiltins::isftz, flush_denorms_to_zero),
std::make_pair(MuxBuiltins ::usefast, UseFast),
Expand Down
11 changes: 0 additions & 11 deletions source/cl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,6 @@ foreach(CL_lib CL CL-static)
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include)

if(CA_CL_FORCE_PROFILE STREQUAL "full")
target_compile_definitions(${CL_lib} PRIVATE
CA_CL_FORCE_PROFILE_STRING="FULL_PROFILE")
elseif(CA_CL_FORCE_PROFILE STREQUAL "embedded")
target_compile_definitions(${CL_lib} PRIVATE
CA_CL_FORCE_PROFILE_STRING="EMBEDDED_PROFILE")
elseif(CA_CL_FORCE_PROFILE)
message(FATAL_ERROR
"Invalid CA_CL_FORCE_PROFILE, only 'full' or 'embedded' allowed.")
endif()

target_link_libraries(${CL_lib}
PUBLIC Threads::Threads
# Optional extra library dependencies set for customer devices
Expand Down
12 changes: 0 additions & 12 deletions source/cl/cmake/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ ca_option(CA_CL_LIBRARY_NAME STRING
ca_option(CA_CL_LIBRARY_VERSION STRING
"Version of the OpenCL shared library" "")

#[=======================================================================[.rst:
.. cmake:variable:: CA_CL_FORCE_PROFILE

A string CMAke option to force the OpenCL platform to report ``"full"`` or
``"embedded"`` profile.

Default value
``""``
#]=======================================================================]
ca_option(CA_CL_FORCE_PROFILE STRING
"Force cl to use 'full' or 'embedded' profile" "")

#[=======================================================================[.rst:
.. cmake:variable:: CA_CL_PUBLIC_LINK_LIBRARIES

Expand Down
2 changes: 0 additions & 2 deletions source/cl/source/binary/include/cl/binary/binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ md_hooks getOpenCLMetadataReadHooks();
///
/// @return "FULL_PROFILE" if the device supports the OpenCL specification, or
/// "EMBEDDED_PROFILE" if the device supports the OpenCL embedded profile. If
/// CA_CL_FORCE_PROFILE_STRING is set when configuring CMake, then that string
/// will be returned instead.
cargo::string_view detectMuxDeviceProfile(cl_bool compiler_available,
mux_device_info_t device);

Expand Down
5 changes: 0 additions & 5 deletions source/cl/source/binary/source/binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,15 +780,10 @@ bool deserializeOpenCLProgramInfo(md_ctx ctx,

cargo::string_view detectMuxDeviceProfile(cl_bool compiler_available,
mux_device_info_t device) {
#ifdef CA_CL_FORCE_PROFILE_STRING
(void)device;
return CA_CL_FORCE_PROFILE_STRING;
#else
if (compiler_available == CL_FALSE) {
return "EMBEDDED_PROFILE";
}
return mux::detectOpenCLProfile(device);
#endif // CA_CL_FORCE_PROFILE_STRING
}

uint32_t detectBuiltinCapabilities(mux_device_info_t device_info) {
Expand Down

0 comments on commit 309776d

Please sign in to comment.