Skip to content

Commit 4bd1ad6

Browse files
jorge-ortegaLegNeato
authored andcommitted
Fix: use core::arch::asm when building cuda target
1 parent 1697114 commit 4bd1ad6

File tree

9 files changed

+18
-7
lines changed

9 files changed

+18
-7
lines changed

crates/cuda_std/src/warp.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
//! thread blocks and execute in SIMT fashion.
55
66
use crate::gpu_only;
7+
#[cfg(target_os = "cuda")]
8+
use core::arch::asm;
79
use half::{bf16, f16};
810

911
/// Synchronizes all of the threads inside of this warp according to `mask`.

crates/optix_device/src/hit.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#[cfg(target_os = "cuda")]
2+
use core::arch::asm;
13
use cuda_std::gpu_only;
24
use glam::Vec3;
3-
45
/// The type of primitive that a ray hit.
56
#[repr(u32)]
67
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

crates/optix_device/src/intersect.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[cfg(target_os = "cuda")]
2+
use core::arch::asm;
13
use cuda_std::gpu_only;
24
use paste::paste;
35
use seq_macro::seq;

crates/optix_device/src/lib.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#![cfg_attr(
2-
target_arch = "nvptx64",
3-
no_std,
4-
feature(asm_experimental_arch),
5-
register_attr(nvvm_internal)
6-
)]
1+
#[cfg(target_os = "cuda")]
2+
use core::arch::asm;
73

84
extern crate alloc;
95

crates/optix_device/src/misc.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[cfg(target_os = "cuda")]
2+
use core::arch::asm;
13
use cuda_std::gpu_only;
24

35
/// Retrieves the data past the SBT header for this particular program

crates/optix_device/src/payload.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
use crate::sys;
2+
#[cfg(target_os = "cuda")]
3+
use core::arch::asm;
24
use cuda_std::gpu_only;
35

46
/// Overrides the payload for the given register to a value.

crates/optix_device/src/ray.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
use crate::trace::*;
2+
#[cfg(target_os = "cuda")]
3+
use core::arch::asm;
24
use cuda_std::gpu_only;
35
use glam::Vec3;
46

crates/optix_device/src/sys.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![allow(clippy::missing_safety_doc)]
22

33
use crate::trace::{RayFlags, TraversableHandle};
4+
#[cfg(target_os = "cuda")]
5+
use core::arch::asm;
46
use cuda_std::gpu_only;
57
use glam::Vec3;
68
use paste::paste;

crates/optix_device/src/transform.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// use std::hint::unreachable_unchecked;
2+
#[cfg(target_os = "cuda")]
3+
use core::arch::asm;
24
use cuda_std::gpu_only;
35
use glam::{Vec3, Vec4};
46

0 commit comments

Comments
 (0)