2020-04-22 23:15:05 +08:00
|
|
|
cmake_minimum_required(VERSION 3.13.4)
|
Initial check-in of Acxxel (StreamExecutor renamed)
Summary:
Acxxel is basically a simplified redesign of StreamExecutor.
Here are the major points where Acxxel differs from the current
StreamExecutor design:
* Acxxel doesn't support the kernel and kernel loader types designed for
emission by the compiler to support type-safe kernel launches. For
CUDA, kernels in Acxxel can be seamlessly launched using the standard
CUDA triple-chevron kernel launch syntax that is available with clang
and nvcc. For CUDA and OpenCL, kernel arguments can be passed in the
old-fashioned way, as one array of pointers to arguments and another
array of argument sizes. Although OpenCL doesn't get a type-safe
kernel launch method, it does still get the benefit of all the memory
management wrappers. In the future, clang may add support for
triple-chevron OpenCL kernel launchs, or some other type-safe OpenCL
kernel launch method.
* Acxxel does not depend on any other code in LLVM, so it builds
completely independently from LLVM.
The goal will be to check in Acxxel and remove StreamExecutor, or
perhaps to remove the old StreamExecutor and rename Acxxel to
StreamExecutor, so I think Acxxel should be thought of as a new version
of StreamExecutor, not as a separate project.
Reviewers: jlebar, jprice
Subscribers: beanz, mgorny, modocache, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D25701
llvm-svn: 285111
2016-10-26 04:18:56 +08:00
|
|
|
|
|
|
|
option(ACXXEL_ENABLE_UNIT_TESTS "enable acxxel unit tests" ON)
|
2016-10-28 08:54:02 +08:00
|
|
|
option(ACXXEL_ENABLE_MULTI_DEVICE_UNIT_TESTS "enable acxxel multi-device unit tests" OFF)
|
Initial check-in of Acxxel (StreamExecutor renamed)
Summary:
Acxxel is basically a simplified redesign of StreamExecutor.
Here are the major points where Acxxel differs from the current
StreamExecutor design:
* Acxxel doesn't support the kernel and kernel loader types designed for
emission by the compiler to support type-safe kernel launches. For
CUDA, kernels in Acxxel can be seamlessly launched using the standard
CUDA triple-chevron kernel launch syntax that is available with clang
and nvcc. For CUDA and OpenCL, kernel arguments can be passed in the
old-fashioned way, as one array of pointers to arguments and another
array of argument sizes. Although OpenCL doesn't get a type-safe
kernel launch method, it does still get the benefit of all the memory
management wrappers. In the future, clang may add support for
triple-chevron OpenCL kernel launchs, or some other type-safe OpenCL
kernel launch method.
* Acxxel does not depend on any other code in LLVM, so it builds
completely independently from LLVM.
The goal will be to check in Acxxel and remove StreamExecutor, or
perhaps to remove the old StreamExecutor and rename Acxxel to
StreamExecutor, so I think Acxxel should be thought of as a new version
of StreamExecutor, not as a separate project.
Reviewers: jlebar, jprice
Subscribers: beanz, mgorny, modocache, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D25701
llvm-svn: 285111
2016-10-26 04:18:56 +08:00
|
|
|
option(ACXXEL_ENABLE_EXAMPLES "enable acxxel examples" OFF)
|
|
|
|
option(ACXXEL_ENABLE_DOXYGEN "enable Doxygen for acxxel" OFF)
|
|
|
|
option(ACXXEL_ENABLE_CUDA "enable CUDA for acxxel" ON)
|
|
|
|
option(ACXXEL_ENABLE_OPENCL "enable OpenCL for acxxel" ON)
|
|
|
|
|
|
|
|
project(acxxel)
|
|
|
|
|
|
|
|
if(ACXXEL_ENABLE_CUDA)
|
|
|
|
find_package(CUDA REQUIRED)
|
|
|
|
include_directories(${CUDA_INCLUDE_DIRS})
|
|
|
|
find_library(CUDA_DRIVER_LIBRARY cuda)
|
|
|
|
if(NOT CUDA_DRIVER_LIBRARY)
|
|
|
|
message(FATAL_ERROR "could not find libcuda, is the CUDA driver installed on your system?")
|
|
|
|
endif(NOT CUDA_DRIVER_LIBRARY)
|
|
|
|
set(ACXXEL_CUDA_SOURCES cuda_acxxel.cpp)
|
|
|
|
set(ACXXEL_CUDA_LIBRARIES ${CUDA_DRIVER_LIBRARY} ${CUDA_LIBRARIES})
|
|
|
|
endif(ACXXEL_ENABLE_CUDA)
|
|
|
|
|
|
|
|
if(ACXXEL_ENABLE_OPENCL)
|
|
|
|
find_package(OpenCL REQUIRED)
|
|
|
|
include_directories(${OpenCL_INCLUDE_DIRS})
|
|
|
|
set(ACXXEL_OPENCL_SOURCES opencl_acxxel.cpp)
|
|
|
|
set(ACXXEL_OPENCL_LIBRARIES ${OpenCL_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
configure_file(config.h.in config.h)
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
|
|
|
# Insist on C++ 11 features.
|
|
|
|
set(CMAKE_CXX_STANDARD 11)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
|
|
# Add warning flags.
|
2016-12-20 05:34:07 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
|
2020-07-23 08:44:52 +08:00
|
|
|
if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
|
|
|
|
add_compile_options("-Wno-suggest-override")
|
|
|
|
endif()
|
Initial check-in of Acxxel (StreamExecutor renamed)
Summary:
Acxxel is basically a simplified redesign of StreamExecutor.
Here are the major points where Acxxel differs from the current
StreamExecutor design:
* Acxxel doesn't support the kernel and kernel loader types designed for
emission by the compiler to support type-safe kernel launches. For
CUDA, kernels in Acxxel can be seamlessly launched using the standard
CUDA triple-chevron kernel launch syntax that is available with clang
and nvcc. For CUDA and OpenCL, kernel arguments can be passed in the
old-fashioned way, as one array of pointers to arguments and another
array of argument sizes. Although OpenCL doesn't get a type-safe
kernel launch method, it does still get the benefit of all the memory
management wrappers. In the future, clang may add support for
triple-chevron OpenCL kernel launchs, or some other type-safe OpenCL
kernel launch method.
* Acxxel does not depend on any other code in LLVM, so it builds
completely independently from LLVM.
The goal will be to check in Acxxel and remove StreamExecutor, or
perhaps to remove the old StreamExecutor and rename Acxxel to
StreamExecutor, so I think Acxxel should be thought of as a new version
of StreamExecutor, not as a separate project.
Reviewers: jlebar, jprice
Subscribers: beanz, mgorny, modocache, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D25701
llvm-svn: 285111
2016-10-26 04:18:56 +08:00
|
|
|
|
|
|
|
add_library(
|
|
|
|
acxxel
|
|
|
|
acxxel.cpp
|
|
|
|
${ACXXEL_CUDA_SOURCES}
|
|
|
|
${ACXXEL_OPENCL_SOURCES})
|
|
|
|
target_link_libraries(
|
|
|
|
acxxel
|
|
|
|
${ACXXEL_CUDA_LIBRARIES}
|
|
|
|
${ACXXEL_OPENCL_LIBRARIES})
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
|
|
|
if(ACXXEL_ENABLE_EXAMPLES)
|
|
|
|
add_subdirectory(examples)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ACXXEL_ENABLE_UNIT_TESTS)
|
|
|
|
enable_testing()
|
|
|
|
find_package(GTest REQUIRED)
|
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
find_package(Threads)
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ACXXEL_ENABLE_DOXYGEN)
|
|
|
|
find_package(Doxygen REQUIRED)
|
|
|
|
configure_file(Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
|
|
|
add_custom_target(
|
|
|
|
acxxel-doc
|
|
|
|
${DOXYGEN_EXECUTABLE}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
|
|
|
|
WORKING_DIRECTORY
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT
|
|
|
|
"Generating acxxel API documentation with Doxygen"
|
|
|
|
VERBATIM)
|
|
|
|
endif()
|