Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neural Network extension - check if the MIOpen's config file exists before reading it #661

Merged
merged 2 commits into from
Oct 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions amd_openvx_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,17 @@ if(GPU_SUPPORT)
#find the MIOPEN backend type
set(MIOPEN_BACKEND_OPENCL_FOUND 0)
set(MIOPEN_BACKEND_HIP_FOUND 0)
file(READ ${ROCM_PATH}/miopen/include/miopen/config.h MIOPEN_CONFIG_FILE)
string(REGEX MATCH "MIOPEN_BACKEND_OPENCL ([0-9]*)" _ ${MIOPEN_CONFIG_FILE})
set(MIOPEN_BACKEND_OPENCL_FOUND ${CMAKE_MATCH_1})
string(REGEX MATCH "MIOPEN_BACKEND_HIP ([0-9]*)" _ ${MIOPEN_CONFIG_FILE})
set(MIOPEN_BACKEND_HIP_FOUND ${CMAKE_MATCH_1})

if(EXISTS ${ROCM_PATH}/miopen/include/miopen/config.h)
file(READ ${ROCM_PATH}/miopen/include/miopen/config.h MIOPEN_CONFIG_FILE)
string(REGEX MATCH "MIOPEN_BACKEND_OPENCL ([0-9]*)" _ ${MIOPEN_CONFIG_FILE})
set(MIOPEN_BACKEND_OPENCL_FOUND ${CMAKE_MATCH_1})
string(REGEX MATCH "MIOPEN_BACKEND_HIP ([0-9]*)" _ ${MIOPEN_CONFIG_FILE})
set(MIOPEN_BACKEND_HIP_FOUND ${CMAKE_MATCH_1})
else()
message("-- ${Red}WARNING: ${ROCM_PATH}/miopen/include/miopen/config.h file Not Found. please run the setup script to install the MIOpen package ${ColourReset}")
endif()

endif()
endif()

Expand Down