Commit ffb13372 authored by carlushuang's avatar carlushuang
Browse files

support clang/aocc

parent 9a7fa123
...@@ -36,9 +36,15 @@ option(CK_TIME_KERNEL "Turning off will disable kernel timing globally" ON) ...@@ -36,9 +36,15 @@ option(CK_TIME_KERNEL "Turning off will disable kernel timing globally" ON)
## OpenMP ## OpenMP
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(OMP_CXX_FLAG -fopenmp=libomp -Wno-unused-command-line-argument) if(NOT CK_NOGPU)
set(OMP_LIBRARY /opt/rocm/llvm/lib/libomp.so) set(OMP_CXX_FLAG -fopenmp=libomp -Wno-unused-command-line-argument)
set(OMP_LINK_FLAG -Wl,-rpath,/opt/rocm/llvm/lib) set(OMP_LIBRARY /opt/rocm/llvm/lib/libomp.so)
set(OMP_LINK_FLAG -Wl,-rpath,/opt/rocm/llvm/lib)
else()
set(OMP_CXX_FLAG -fopenmp)
set(OMP_LIBRARY "")
set(OMP_LINK_FLAG -fopenmp)
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(OMP_CXX_FLAG -fopenmp) set(OMP_CXX_FLAG -fopenmp)
set(OMP_LIBRARY "") set(OMP_LIBRARY "")
......
...@@ -8,7 +8,8 @@ namespace ck { ...@@ -8,7 +8,8 @@ namespace ck {
using bhalf_t = ushort; using bhalf_t = ushort;
#ifdef CK_NOGPU #ifdef CK_NOGPU
using half_t = half_float::half; using half_t = int16_t; // TODO: some version of clang complains about half_float::half is not POD,
// hence can't be used in ext_vector_type()
#else #else
using half_t = _Float16; using half_t = _Float16;
#endif #endif
......
#!/bin/bash
rm -f CMakeCache.txt
rm -f *.cmake
rm -rf CMakeFiles
AVX2_FLAGS='-m64 -mavx2 -mf16c -mfma -DHALF_ENABLE_F16C_INTRINSICS=0'
rm -rf build/
mkdir build && cd build
MY_PROJECT_SOURCE=..
MY_PROJECT_INSTALL=../install.dir
rm -rf $MY_PROJECT_INSTALL
mkdir $MY_PROJECT_INSTALL
cmake \
-D CMAKE_INSTALL_PREFIX=${MY_PROJECT_INSTALL} \
-D BUILD_DEV=OFF \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS=" $AVX2_FLAGS " \
-D CMAKE_CXX_COMPILER=clang++ \
-D CMAKE_PREFIX_PATH=/usr/local \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-D CK_NOGPU=ON \
${MY_PROJECT_SOURCE}
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