Skip to content

Miopen defines #123

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

Merged
merged 2 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion aten/src/ATen/cuda/CUDAConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// c.f. https://stackoverflow.com/questions/33759787/generating-an-error-if-checked-boolean-macro-is-not-defined

#define AT_CUDNN_ENABLED() @AT_CUDNN_ENABLED@
#define AT_MIOPEN_ENABLED() @AT_MIOPEN_ENABLED@
#define AT_ROCM_ENABLED() @AT_ROCM_ENABLED@
2 changes: 1 addition & 1 deletion aten/src/ATen/cuda/detail/CUDAHooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool CUDAHooks::compiledWithCuDNN() const {
}

bool CUDAHooks::compiledWithMIOpen() const {
return AT_MIOPEN_ENABLED();
return AT_ROCM_ENABLED();
}

bool CUDAHooks::supportsDilatedConvolutionWithCuDNN() const {
Expand Down
4 changes: 2 additions & 2 deletions aten/src/ATen/native/miopen/BatchNorm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <ATen/cuda/CUDAConfig.h>

#if !AT_MIOPEN_ENABLED()
#if !AT_ROCM_ENABLED()

namespace at { namespace native {

Expand All @@ -27,7 +27,7 @@ std::tuple<Tensor, Tensor, Tensor> miopen_batch_norm_backward(

}} // namespace at::native

#else // AT_MIOPEN_ENABLED
#else // AT_ROCM_ENABLED

#include <ATen/miopen/Descriptors.h>
#include <ATen/miopen/Types.h>
Expand Down
4 changes: 2 additions & 2 deletions aten/src/ATen/native/miopen/Conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <ATen/Config.h>
#include <ATen/cuda/CUDAConfig.h>

#if !AT_MIOPEN_ENABLED()
#if !AT_ROCM_ENABLED()

namespace at { namespace native {

Expand Down Expand Up @@ -72,7 +72,7 @@ std::tuple<at::Tensor,at::Tensor,at::Tensor> miopen_convolution_transpose_backwa

}}

#else // AT_MIOPEN_ENABLED
#else // AT_ROCM_ENABLED

#include "THC/THC.h"

Expand Down
5 changes: 3 additions & 2 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1218,11 +1218,12 @@ if (BUILD_ATEN)
ENDIF()

IF (NOT USE_ROCM)
message("disabling ROCM because NOT USE_ROCM is set")
MESSAGE(STATUS "MIOpen not found. Compiling without MIOpen support")
set(AT_MIOPEN_ENABLED 0)
set(AT_ROCM_ENABLED 0)
ELSE()
INCLUDE_DIRECTORIES(BEFORE ${MIOPEN_INCLUDE_DIRS})
set(AT_MIOPEN_ENABLED 1)
set(AT_ROCM_ENABLED 1)
ENDIF()

if (NO_MKLDNN)
Expand Down