Skip to content

Commit

Permalink
Enable Geekbench 5 (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
vosen authored Dec 10, 2024
1 parent 7a6df9d commit 7ac67a8
Show file tree
Hide file tree
Showing 42 changed files with 24,893 additions and 15,443 deletions.
1 change: 1 addition & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && DEBIAN_FRONTEND=noninter
libgl-dev libegl-dev libvdpau-dev \
nvidia-utils-${CUDA_DRIVER} \
cuda-cudart-dev-${CUDA_PKG_VERSION} \
cuda-nvml-dev-${CUDA_PKG_VERSION} \
cuda-cudart-${CUDA_PKG_VERSION} \
cuda-profiler-api-${CUDA_PKG_VERSION} \
cuda-nvcc-${CUDA_PKG_VERSION}
Expand Down
20 changes: 17 additions & 3 deletions comgr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use amd_comgr_sys::*;
use std::{ffi::CStr, iter, mem, ptr};
use std::{ffi::CStr, mem, ptr};

struct Data(amd_comgr_data_t);

Expand Down Expand Up @@ -137,15 +137,29 @@ pub fn compile_bitcode(
link_with_device_libs_info.set_isa_name(gcn_arch)?;
link_with_device_libs_info.set_language(amd_comgr_language_t::AMD_COMGR_LANGUAGE_LLVM_IR)?;
// This makes no sense, but it makes ockl linking work
link_with_device_libs_info.set_options([c"-Xclang", c"-mno-link-builtin-bitcode-postopt"].into_iter())?;
link_with_device_libs_info
.set_options([c"-Xclang", c"-mno-link-builtin-bitcode-postopt"].into_iter())?;
let with_device_libs = do_action(
&linked_data_set,
&link_with_device_libs_info,
amd_comgr_action_kind_t::AMD_COMGR_ACTION_COMPILE_SOURCE_WITH_DEVICE_LIBS_TO_BC,
)?;
let compile_action_info = ActionInfo::new()?;
compile_action_info.set_isa_name(gcn_arch)?;
compile_action_info.set_options(iter::once(c"-O3"))?;
let common_options = [c"-O3", c"-mno-wavefrontsize64", c"-mcumode"].into_iter();
let opt_options = if cfg!(debug_assertions) {
[c"-g", c"", c"", c"", c""]
} else {
[
c"-g0",
// default inlining threshold times 10
c"-mllvm",
c"-inline-threshold=2250",
c"-mllvm",
c"-inlinehint-threshold=3250",
]
};
compile_action_info.set_options(common_options.chain(opt_options))?;
let reloc_data_set = do_action(
&with_device_libs,
&compile_action_info,
Expand Down
2 changes: 1 addition & 1 deletion cuda_base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"

[dependencies]
quote = "1.0"
syn = { version = "2.0", features = ["full", "visit-mut"] }
syn = { version = "2.0", features = ["full", "visit-mut", "extra-traits"] }
proc-macro2 = "1.0"
rustc-hash = "1.1.0"

Expand Down
Loading

0 comments on commit 7ac67a8

Please sign in to comment.