Skip to content

Instantly share code, notes, and snippets.

View xwang233's full-sized avatar
🐢
Premature optimization is the root of all evil

Wang, Xiao xwang233

🐢
Premature optimization is the root of all evil
View GitHub Profile
@xwang233
xwang233 / get_cuda_arch.sh
Last active December 17, 2020 06:39
Shell script for determining the SM value for your (single) GPU. Based on https://gist.github.com/eyalroz/71ce52fa80acdd1c3b192e43a6c1d930
#!/bin/bash
#
# Prints the compute capability of all the CUDA device installed
# on the system.
timestamp=$(date +%s.%N)
gcc_binary=${CMAKE_CXX_COMPILER:-$(which c++)}
cuda_root=${CUDA_DIR:-/usr/local/cuda}
CUDA_INCLUDE_DIRS=${CUDA_INCLUDE_DIRS:-${cuda_root}/include}
CUDA_CUDART_LIBRARY=${CUDA_CUDART_LIBRARY:-${cuda_root}/lib64/libcudart.so}