+
Skip to content
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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载