-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from CHIP-SPV/cuspv
direct CUDA compilation support
- Loading branch information
Showing
150 changed files
with
598,833 additions
and
256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Read includes, prepend each one with -I. | ||
set(prop "$<TARGET_PROPERTY:CHIP,INCLUDE_DIRECTORIES>") | ||
set(CHIP_INCLUDES "$<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>") | ||
|
||
# Generate cuspvc tool that is usable within build directory. | ||
configure_file(cuspvc-build.in cuspvc-build.in @ONLY) | ||
file( | ||
GENERATE | ||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cuspvc | ||
INPUT ${CMAKE_CURRENT_BINARY_DIR}/cuspvc-build.in) | ||
|
||
# Generate cuspv tool that will be installed. | ||
configure_file(cuspvc-install.in cuspvc-install @ONLY) | ||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/cuspvc-install | ||
DESTINATION bin RENAME cuspvc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
# CUDA-SPIRV compiler - A compiler wrapper for compiling CUDA sources directly. | ||
# | ||
# CUDA sources are compiled in HIP mode with an include search path to | ||
# cuda_runtime.h wrapper which translates CUDA API to HIP API. | ||
# | ||
# NOTE: this file is not meant only to be usable in CHIP-SPV build directory. | ||
export HIP_PLATFORM=spirv | ||
export PATH=@CMAKE_BINARY_DIR@/bin:$PATH | ||
hipcc @CHIP_INCLUDES@ "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# CUDA-SPIRV compiler - A compiler wrapper for compiling CUDA sources directly. | ||
# | ||
# CUDA sources are compiled in HIP mode with an include search path to | ||
# cuda_runtime.h wrapper which translates CUDA API to HIP API. | ||
export HIP_PLATFORM=spirv | ||
# Add path for locating hipcc. | ||
export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH | ||
hipcc -I@CMAKE_INSTALL_PREFIX@/include/cuspv "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// in CUDA, this header has the driver API definitions. | ||
// we include both driver & runtime in the same header | ||
|
||
#include <cuda_runtime.h> |
Oops, something went wrong.