Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing compatibility for compute cap 70-75 #757

Merged
merged 2 commits into from
May 1, 2023
Merged
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
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ mod cuda {
compute_cap = max_nvcc_code;
}

println!("cargo:rerun-if-env-changed=CUDA_COMPUTE_CAP");
if let Ok(compute_cap_str) = std::env::var("CUDA_COMPUTE_CAP") {
compute_cap = compute_cap_str.parse::<usize>().unwrap();
println!("cargo:warning=Using gpu arch {compute_cap} from $CUDA_COMPUTE_CAP");
}

println!("cargo:rustc-env=CUDA_COMPUTE_CAP=sm_{compute_cap}");

kernel_paths
Expand Down
2 changes: 1 addition & 1 deletion src/tensor_ops/utilities/compatibility.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

// FIXME: the minimum compute capabilities are just guesses since the table is not specific enough

#if __CUDA_ARCH__ < 600
#if __CUDA_ARCH__ < 800
__device__ __forceinline__ __half __hmax(__half a, __half b) {
return __float2half(fmaxf(__half2float(a), __half2float(b)));
}
Expand Down
Loading