-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
2,946 additions
and
517 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "hemi/range"] | ||
path = hemi/range | ||
url = https://github.com/harrism/cpp11-range.git | ||
[submodule "test/googletest"] | ||
path = test/googletest | ||
url = https://github.com/google/googletest.git |
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,12 @@ | ||
- [ ] Consider abstraction for __shared__ memory | ||
- [ ] Make nbody example work without CUDA | ||
- [ ] Consider __launch_bounds__ support... | ||
- [ ] Multi-dimensional thread/block accessors | ||
- [x] Add version of parallel_for with an ExecutionPolicy | ||
- [x] Combine tests into small number of binaries | ||
- [x] Add streams to ExecutionPolicy | ||
- [x] Tests for cudaLaunch with and without nvcc | ||
- [x] Tests for other APIs | ||
- [x] Provide portable utility functions for cudaDeviceReset, etc. | ||
- [x] Fix/rename index accessors | ||
- [x] Move accessors to device_api.h |
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 |
---|---|---|
@@ -1,36 +1,43 @@ | ||
CUDA_PATH := /usr/local/cuda | ||
# operating system | ||
HOST_OS := $(shell uname -s 2>/dev/null | tr "[:upper:]" "[:lower:]") | ||
|
||
CC_FLAGS := -I../ -I../../ -I$(CUDA_PATH)/include | ||
# architecture | ||
ARCH := $(shell getconf LONG_BIT) | ||
|
||
# uncomment for debug | ||
#DEBUG_FLAGS := -g -DDEBUG | ||
#DEBUG_FLAGS_NVCC := -G | ||
NVCC := nvcc | ||
|
||
# comment for debug | ||
CC_FLAGS += -O3 | ||
ifeq ($(HOST_OS),darwin) | ||
CXX := clang++ | ||
else | ||
CXX := g++ | ||
endif | ||
|
||
CC_FLAGS += $(DEBUG_FLAGS) | ||
NVCC_FLAGS := $(CC_FLAGS) $(DEBUG_FLAGS_NVCC) | ||
STD := -std=c++11 | ||
|
||
NVCC_FLAGS := $(CC_FLAGS) $(DEBUG_FLAGS_NVCC) | ||
CXX_FLAGS := $(STD) -I../ -I../../ | ||
|
||
ARCH := $(shell getconf LONG_BIT) | ||
HOST_ONLY_FLAGS := -DHEMI_CUDA_DISABLE | ||
|
||
LIB_FLAGS_32 := -L$(CUDA_PATH)/lib | ||
LIB_FLAGS_64 := -L$(CUDA_PATH)/lib64 | ||
# uncomment for debug | ||
#DEBUG_FLAGS := -g -DDEBUG | ||
#DEBUG_FLAGS_NVCC := -G | ||
|
||
# comment for debug | ||
CXX_FLAGS += -O3 | ||
|
||
LIB_FLAGS := $(LIB_FLAGS_$(ARCH)) -lcudart | ||
CXX_FLAGS += $(DEBUG_FLAGS) | ||
NVCC_FLAGS := $(CXX_FLAGS) $(DEBUG_FLAGS_NVCC) --expt-extended-lambda | ||
|
||
all: bs_device bs_host_nvcc bs_host_g++ | ||
all: bs_device bs_host_nvcc bs_host | ||
|
||
bs_device: blackscholes.cpp | ||
nvcc blackscholes.cpp $(NVCC_FLAGS) $(LIB_FLAGS) -x cu -o bs_device | ||
$(NVCC) blackscholes.cpp $(NVCC_FLAGS) -x cu -o bs_device | ||
|
||
bs_host_nvcc: blackscholes.cpp | ||
nvcc blackscholes.cpp $(CC_FLAGS) $(LIB_FLAGS) -x c++ -o bs_host_nvcc | ||
$(NVCC) blackscholes.cpp $(CXX_FLAGS) $(HOST_ONLY_FLAGS) -x c++ -o bs_host_nvcc | ||
|
||
bs_host_g++: blackscholes.cpp | ||
g++ blackscholes.cpp $(CC_FLAGS) $(LIB_FLAGS) -o bs_host_g++ | ||
bs_host: blackscholes.cpp | ||
$(CXX) blackscholes.cpp $(CXX_FLAGS) $(HOST_ONLY_FLAGS) -o bs_host | ||
|
||
clean: | ||
rm -rf bs_device bs_host_nvcc bs_host_g++ | ||
rm -rf bs_device bs_host_nvcc bs_host |
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,36 +1,43 @@ | ||
CUDA_PATH := /usr/local/cuda | ||
# operating system | ||
HOST_OS := $(shell uname -s 2>/dev/null | tr "[:upper:]" "[:lower:]") | ||
|
||
CC_FLAGS := -I../ -I../../ -I$(CUDA_PATH)/include | ||
# architecture | ||
ARCH := $(shell getconf LONG_BIT) | ||
|
||
# uncomment for debug | ||
#DEBUG_FLAGS := -g -DDEBUG | ||
#DEBUG_FLAGS_NVCC := -G | ||
NVCC := nvcc | ||
|
||
# comment for debug | ||
CC_FLAGS += -O3 | ||
ifeq ($(HOST_OS),darwin) | ||
CXX := clang++ | ||
else | ||
CXX := g++ | ||
endif | ||
|
||
CC_FLAGS += $(DEBUG_FLAGS) | ||
NVCC_FLAGS := $(CC_FLAGS) $(DEBUG_FLAGS_NVCC) | ||
STD := -std=c++11 | ||
|
||
NVCC_FLAGS := $(CC_FLAGS) $(DEBUG_FLAGS_NVCC) | ||
CXX_FLAGS := $(STD) -I../ -I../../ | ||
|
||
ARCH := $(shell getconf LONG_BIT) | ||
HOST_ONLY_FLAGS := -DHEMI_CUDA_DISABLE | ||
|
||
LIB_FLAGS_32 := -L$(CUDA_PATH)/lib | ||
LIB_FLAGS_64 := -L$(CUDA_PATH)/lib64 | ||
# uncomment for debug | ||
#DEBUG_FLAGS := -g -DDEBUG | ||
#DEBUG_FLAGS_NVCC := -G | ||
|
||
# comment for debug | ||
CXX_FLAGS += -O3 | ||
|
||
LIB_FLAGS := $(LIB_FLAGS_$(ARCH)) -lcudart | ||
CXX_FLAGS += $(DEBUG_FLAGS) | ||
NVCC_FLAGS := $(CXX_FLAGS) $(DEBUG_FLAGS_NVCC) --expt-extended-lambda | ||
|
||
all: bs_device bs_host_nvcc bs_host_g++ | ||
all: bs_device bs_host_nvcc bs_host | ||
|
||
bs_device: blackscholes.cpp | ||
nvcc blackscholes.cpp $(NVCC_FLAGS) $(LIB_FLAGS) -x cu -o bs_device | ||
$(NVCC) blackscholes.cpp $(NVCC_FLAGS) -x cu -o bs_device | ||
|
||
bs_host_nvcc: blackscholes.cpp | ||
nvcc blackscholes.cpp $(CC_FLAGS) $(LIB_FLAGS) -x c++ -o bs_host_nvcc | ||
$(NVCC) blackscholes.cpp $(CXX_FLAGS) $(HOST_ONLY_FLAGS) -x c++ -o bs_host_nvcc | ||
|
||
bs_host_g++: blackscholes.cpp | ||
g++ blackscholes.cpp $(CC_FLAGS) $(LIB_FLAGS) -o bs_host_g++ | ||
bs_host: blackscholes.cpp | ||
$(CXX) blackscholes.cpp $(CXX_FLAGS) $(HOST_ONLY_FLAGS) -o bs_host | ||
|
||
clean: | ||
rm -rf bs_device bs_host_nvcc bs_host_g++ | ||
rm -rf bs_device bs_host_nvcc bs_host |
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
Oops, something went wrong.