Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Fix compilation with Cuda 8.0 #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,27 @@ if(CUDA_FOUND)
# to make sure more people can easily run class code without knowing
# about this compiler argument
set(CUDA_NVCC_FLAGS "
-ccbin /usr/bin/clang;
-gencode;arch=compute_30,code=sm_30;
-gencode;arch=compute_35,code=sm_35;
-gencode;arch=compute_35,code=compute_35;
-gencode;arch=compute_20,code=sm_20;
-gencode;arch=compute_11,code=sm_11;
-gencode;arch=compute_12,code=sm_12;
-gencode;arch=compute_13,code=sm_13;")
-gencode;arch=compute_20,code=sm_20;")

# add -Wextra compiler flag for gcc compilations
if (UNIX)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-ccbin /usr/bin/clang")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler -Wextra")
set(CMAKE_CXX_FLAGS "-stdlib=libstdc++")
endif (UNIX)

# add debugging to CUDA NVCC flags. For NVidia's NSight tools.
set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG} "-G")

add_subdirectory (HW1)
add_subdirectory (HW2)
add_subdirectory (HW3)
add_subdirectory (HW4)
add_subdirectory (HW5)
add_subdirectory (HW6)
add_subdirectory ("Problem Sets/Problem Set 1")
add_subdirectory ("Problem Sets/Problem Set 2")
add_subdirectory ("Problem Sets/Problem Set 3")
add_subdirectory ("Problem Sets/Problem Set 4")
add_subdirectory ("Problem Sets/Problem Set 5")
add_subdirectory ("Problem Sets/Problem Set 6")
else(CUDA_FOUND)
message("CUDA is not installed on this system.")
endif()
1 change: 1 addition & 0 deletions Problem Sets/Problem Set 1/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cuda_runtime_api.h>
#include <cassert>
#include <cmath>
#include <algorithm>

#define checkCudaErrors(val) check( (val), #val, __FILE__, __LINE__)

Expand Down
1 change: 1 addition & 0 deletions Problem Sets/Problem Set 3/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cuda_runtime_api.h>
#include <cassert>
#include <cmath>
#include <algorithm>

#define checkCudaErrors(val) check( (val), #val, __FILE__, __LINE__)

Expand Down
1 change: 1 addition & 0 deletions Problem Sets/Problem Set 4/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cuda_runtime_api.h>
#include <cassert>
#include <cmath>
#include <algorithm>

#define checkCudaErrors(val) check( (val), #val, __FILE__, __LINE__)

Expand Down
3 changes: 2 additions & 1 deletion Problem Sets/Problem Set 5/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "utils.h"
#include "timer.h"
#include <cstdio>
#include <algorithm>
#if defined(_WIN16) || defined(_WIN32) || defined(_WIN64)
#include <Windows.h>
#else
Expand Down Expand Up @@ -51,7 +52,7 @@ int main(void)

thrust::minstd_rand rng;

thrust::random::experimental::normal_distribution<float> normalDist((float)mean, stddev);
thrust::random::normal_distribution<float> normalDist((float)mean, stddev);

// Generate the random values
for (size_t i = 0; i < numElems; ++i) {
Expand Down
1 change: 1 addition & 0 deletions Problem Sets/Problem Set 5/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cuda_runtime_api.h>
#include <cassert>
#include <cmath>
#include <algorithm>

#define checkCudaErrors(val) check( (val), #val, __FILE__, __LINE__)

Expand Down
1 change: 1 addition & 0 deletions Problem Sets/Problem Set 6/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cuda_runtime_api.h>
#include <cassert>
#include <cmath>
#include <algorithm>

#define checkCudaErrors(val) check( (val), #val, __FILE__, __LINE__)

Expand Down