Unverified Commit 1c8fcfc9 authored by Paul Fultz II's avatar Paul Fultz II Committed by GitHub
Browse files

Set find mode in miopen to normal (#711)

parent c9b86f1c
...@@ -256,6 +256,17 @@ target_compile_definitions(migraphx_gpu PRIVATE ...@@ -256,6 +256,17 @@ target_compile_definitions(migraphx_gpu PRIVATE
"-DMIGRAPHX_EXTRACT_KERNEL=${MIGRAPHX_EXTRACT_KERNEL}" "-DMIGRAPHX_EXTRACT_KERNEL=${MIGRAPHX_EXTRACT_KERNEL}"
) )
# Check miopen find mode api
include(CheckLibraryExists)
get_target_property(MIOPEN_LOCATION MIOpen LOCATION)
check_library_exists(MIOpen "miopenHiddenSetConvolutionFindMode" "${MIOPEN_LOCATION}" HAS_FIND_MODE_API)
if(HAS_FIND_MODE_API)
target_compile_definitions(migraphx_gpu PUBLIC -DMIGRAPHX_HAS_FIND_MODE_API)
message(STATUS "MIOpen has find mode api")
else()
message(STATUS "MIOpen does not have find mode api")
endif()
# Workaround broken rocblas headers # Workaround broken rocblas headers
target_compile_definitions(migraphx_gpu PUBLIC -D__HIP_PLATFORM_HCC__=1) target_compile_definitions(migraphx_gpu PUBLIC -D__HIP_PLATFORM_HCC__=1)
target_compile_options(migraphx_gpu PRIVATE -std=c++17) target_compile_options(migraphx_gpu PRIVATE -std=c++17)
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
#include <miopen/miopen.h> #include <miopen/miopen.h>
#include <migraphx/config.hpp> #include <migraphx/config.hpp>
#ifdef HAS_FIND_MODE_API
extern "C" miopenStatus_t miopenHiddenSetConvolutionFindMode(miopenConvolutionDescriptor_t convDesc,
int findMode);
#endif
namespace migraphx { namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
...@@ -97,6 +102,9 @@ inline convolution_descriptor make_conv(const T& op) ...@@ -97,6 +102,9 @@ inline convolution_descriptor make_conv(const T& op)
c.get(), padding.size(), padding.data(), stride.data(), dilation.data(), c_mode); c.get(), padding.size(), padding.data(), stride.data(), dilation.data(), c_mode);
if(op.group > 1) if(op.group > 1)
miopenSetConvolutionGroupCount(c.get(), op.group); miopenSetConvolutionGroupCount(c.get(), op.group);
#ifdef HAS_FIND_MODE_API
miopenHiddenSetConvolutionFindMode(c.get(), 1); // Normal mode
#endif
return c; return c;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment