Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
ffb13372
Commit
ffb13372
authored
May 17, 2022
by
carlushuang
Browse files
support clang/aocc
parent
9a7fa123
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
4 deletions
+36
-4
CMakeLists.txt
CMakeLists.txt
+9
-3
include/ck/utility/data_type.hpp
include/ck/utility/data_type.hpp
+2
-1
script/cmake-avx2-clang-aocc.sh
script/cmake-avx2-clang-aocc.sh
+25
-0
No files found.
CMakeLists.txt
View file @
ffb13372
...
@@ -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
""
)
...
...
include/ck/utility/data_type.hpp
View file @
ffb13372
...
@@ -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
...
...
script/cmake-avx2-clang-aocc.sh
0 → 100755
View file @
ffb13372
#!/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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment