Workaround for libc++ include path for HIP-Clang (#1917)

HIP-Clang cuda_wrapper headers require clang include path before standard C++ include path.
However libc++ include path requires to be before clang include path.
To workaround this, we pass -isystem with the parent directory of clang include
path instead of the clang include path itself.
このコミットが含まれているのは:
Yaxun (Sam) Liu
2020-03-18 01:50:21 -04:00
committed by GitHub
コミット 08d9759eba
2個のファイルの変更9行の追加4行の削除
+1 -1
ファイルの表示
@@ -207,7 +207,7 @@ if ($HIP_PLATFORM eq "clang") {
} else {
$HIPCXXFLAGS .= " -std=c++11";
}
$HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH";
$HIPCXXFLAGS .= " -isystem $HIP_CLANG_INCLUDE_PATH/..";
$HIPLDFLAGS .= " -L$HIP_LIB_PATH";
if (not $isWindows) {
$HIPLDFLAGS .= " -Wl,--rpath-link=$HIP_LIB_PATH";
+8 -3
ファイルの表示
@@ -501,9 +501,14 @@ hc_get_workitem_absolute_id(int dim)
#define __CUDA__
#include <__clang_cuda_math_forward_declares.h>
#include <__clang_cuda_complex_builtins.h>
#include <cuda_wrappers/algorithm>
#include <cuda_wrappers/complex>
#include <cuda_wrappers/new>
// Workaround for using libc++ with HIP-Clang.
// The following headers requires clang include path before standard C++ include path.
// However libc++ include path requires to be before clang include path.
// To workaround this, we pass -isystem with the parent directory of clang include
// path instead of the clang include path itself.
#include <include/cuda_wrappers/algorithm>
#include <include/cuda_wrappers/complex>
#include <include/cuda_wrappers/new>
#undef __CUDA__
#pragma pop_macro("__CUDA__")
#endif // !_OPENMP || __HIP_ENABLE_CUDA_WRAPPER_FOR_OPENMP__