Skip to content

Commit 32d42e3

Browse files
committed
temporarily switch fatal to bug to try to track something down
1 parent d7ad3fe commit 32d42e3

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

crates/rustc_codegen_nvvm_v19/src/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ impl<'ll, 'tcx, 'a> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
10351035
) -> (&'ll Value, &'ll Value) {
10361036
// allowed but only for some things and with restrictions
10371037
// https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#cmpxchg-instruction
1038-
self.fatal("atomic cmpxchg is not supported")
1038+
bug!("atomic cmpxchg is not supported")
10391039
}
10401040
fn atomic_rmw(
10411041
&mut self,
@@ -1045,15 +1045,15 @@ impl<'ll, 'tcx, 'a> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
10451045
_order: rustc_codegen_ssa::common::AtomicOrdering,
10461046
) -> &'ll Value {
10471047
// see cmpxchg comment
1048-
self.fatal("atomic rmw is not supported")
1048+
bug!("atomic rmw is not supported")
10491049
}
10501050

10511051
fn atomic_fence(
10521052
&mut self,
10531053
_order: rustc_codegen_ssa::common::AtomicOrdering,
10541054
_scope: rustc_codegen_ssa::common::SynchronizationScope,
10551055
) {
1056-
self.fatal("atomic fence is not supported, use cuda_std intrinsics instead")
1056+
bug!("atomic fence is not supported, use cuda_std intrinsics instead")
10571057
}
10581058

10591059
fn set_invariant_load(&mut self, load: &'ll Value) {

examples/cuda/vecadd/kernels/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ edition = "2024"
55

66
[dependencies]
77
cuda_std = { path = "../../../../crates/cuda_std" }
8-
rand_core = { version = "0.9.3" }
9-
rand_xoshiro = { version = "0.7.0", default-features = false }
108

119
[lib]
1210
crate-type = ["cdylib", "rlib"]

examples/cuda/vecadd/kernels/src/lib.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,5 @@
11
use cuda_std::prelude::*;
22

3-
use rand_core::{SeedableRng, RngCore};
4-
use rand_xoshiro::Xoroshiro128StarStar;
5-
6-
const BASE64_CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
7-
8-
fn splitmix64(mut x: u64) -> u64 {
9-
x = x.wrapping_add(0x9e3779b97f4a7c15u64);
10-
x = (x ^ (x >> 30)).wrapping_mul(0xbf58476d1ce4e5b9u64);
11-
x = (x ^ (x >> 27)).wrapping_mul(0x94d049bb133111ebu64);
12-
x ^ (x >> 31)
13-
}
14-
15-
pub fn generate_random_private_key(thread_idx: usize, rng_seed: u64) -> [u8; 32] {
16-
let mixed_seed = splitmix64(rng_seed.wrapping_add(thread_idx as u64));
17-
let mut private_key = [0u8; 32];
18-
let mut rng = Xoroshiro128StarStar::seed_from_u64(mixed_seed);
19-
rng.fill_bytes(&mut private_key);
20-
private_key
21-
}
22-
23-
pub fn generate_base64_nonce(thread_idx: usize, rng_seed: u64, nonce: &mut [u8]) {
24-
let mixed_seed = splitmix64(rng_seed.wrapping_add(thread_idx as u64));
25-
let mut rng = Xoroshiro128StarStar::seed_from_u64(mixed_seed);
26-
for byte in nonce.iter_mut() {
27-
let idx = (rng.next_u32() % 64) as usize;
28-
*byte = BASE64_CHARS[idx];
29-
}
30-
}
31-
323
#[kernel]
334
#[allow(improper_ctypes_definitions, clippy::missing_safety_doc)]
345
pub unsafe fn vecadd(a: &[f32], b: &[f32], c: *mut f32) {

0 commit comments

Comments
 (0)