Skip to content

Commit

Permalink
Updated CMakeLists to build correct supported architectures automatic…
Browse files Browse the repository at this point in the history
…ally
  • Loading branch information
DavidMChan committed Apr 23, 2021
1 parent 2a32b10 commit 22a5e10
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 21 deletions.
61 changes: 50 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,57 @@ if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()

if(CUDAToolkit_VERSION_MAJOR EQUAL "10")
set(CUDA_ARCH
-gencode=arch=compute_30,code=sm_30
-gencode=arch=compute_35,code=sm_35
-gencode=arch=compute_37,code=sm_37
-gencode=arch=compute_50,code=sm_50
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_60,code=sm_60
-gencode=arch=compute_61,code=sm_61
-gencode=arch=compute_70,code=sm_70
-gencode=arch=compute_75,code=sm_75
)
elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11" AND CUDAToolkit_VERSION_MINOR LESS "1")
set(CUDA_ARCH
-gencode=arch=compute_30,code=sm_30
-gencode=arch=compute_35,code=sm_35
-gencode=arch=compute_37,code=sm_37
-gencode=arch=compute_50,code=sm_50
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_60,code=sm_60
-gencode=arch=compute_61,code=sm_61
-gencode=arch=compute_70,code=sm_70
-gencode=arch=compute_75,code=sm_75
-gencode=arch=compute_80,code=sm_80
)
elseif(CUDAToolkit_VERSION_MAJOR EQUAL "11")
set(CUDA_ARCH
-gencode=arch=compute_30,code=sm_30
-gencode=arch=compute_35,code=sm_35
-gencode=arch=compute_37,code=sm_37
-gencode=arch=compute_50,code=sm_50
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_60,code=sm_60
-gencode=arch=compute_61,code=sm_61
-gencode=arch=compute_70,code=sm_70
-gencode=arch=compute_75,code=sm_75
-gencode=arch=compute_80,code=sm_80
-gencode=arch=compute_86,code=sm_86
)
else()
set(CUDA_ARCH
-gencode=arch=compute_30,code=sm_30
-gencode=arch=compute_35,code=sm_35
-gencode=arch=compute_37,code=sm_37
-gencode=arch=compute_50,code=sm_50
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_60,code=sm_60
-gencode=arch=compute_61,code=sm_61
)
endif()

set(CUDA_ARCH
-gencode=arch=compute_35,code=sm_35
-gencode=arch=compute_50,code=sm_50
-gencode=arch=compute_52,code=sm_52
-gencode=arch=compute_60,code=sm_60
-gencode=arch=compute_61,code=sm_61
-gencode=arch=compute_70,code=sm_70
-gencode=arch=compute_75,code=sm_75
-gencode=arch=compute_80,code=sm_80
-gencode=arch=compute_86,code=sm_86
)

set(CUDA_OPTS
-O3
Expand Down
2 changes: 1 addition & 1 deletion conda/Dockerfile.cuda11.0
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ RUN conda init
ADD ./ /tsnecuda/
WORKDIR /tsnecuda/conda

# ENTRYPOINT conda-build ./tsnecuda/ --variants '{ "cudatoolkit": "11.0", "python":"3.8" }' -c pytorch -c conda-forge
# ENTRYPOINT conda-build ./tsnecuda/ --variants '{ "cudatoolkit": "11.0" }' -c pytorch -c conda-forge
5 changes: 0 additions & 5 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
python:
- 3.6
- 3.7
- 3.8
- 3.9
cudatoolkit:
- 10.1
- 10.2
Expand Down
7 changes: 3 additions & 4 deletions conda/tsnecuda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,12 @@ outputs:
string: "h{{ PKG_HASH }}_{{ number }}_cuda{{ cudatoolkit }}"
run_exports:
- {{ pin_compatible('tsnecuda', exact=True) }}

requirements:
build:
- {{ compiler('cxx') }}
- make
- git
- python {{ python }}
- python >=3.5
- libxml2
host:
- conda
Expand All @@ -54,7 +53,7 @@ outputs:
- blas =*=mkl
- cudatoolkit-dev {{ cudatoolkit }}
- faiss-gpu ==1.6.5
- python {{ python }}
- python >=3.5
- numpy >=1.14
- gflags
- gtest
Expand All @@ -64,7 +63,7 @@ outputs:
- mkl >=2018
- blas =*=mkl
- faiss-gpu ==1.6.5
- python {{ python }}
- python >=3.5
- {{ pin_compatible('cudatoolkit', max_pin='x.x') }}
- {{ pin_compatible('numpy') }}
- gflags
Expand Down

0 comments on commit 22a5e10

Please sign in to comment.