Skip to content
This repository was archived by the owner on Mar 28, 2022. It is now read-only.
This repository was archived by the owner on Mar 28, 2022. It is now read-only.

Compile entire crate by nvptx64-nvidia-cuda target #72

Description

@termoshtt

A proposition to resolve #61

Motivation

#[kernel] function cannot use any variable, function, and so on because it will be compiled as a stand alone device code.

fn add_2(a: &mut f32) {
    *a = *a + 2.0;
}

#[kernel] 
pub fn add_2_all(a: *mut f32, n: usize) {
    let i = ::accel_core::index();
    unsafe { add_2(&mut *a.offset(i)) };  // add_2 cannot find
}

Resolution

Compile entire crate both as x86_64 and nvptx64 targets.

  • rust-ptx-linker will eliminate non-PTX kernel code which does not called from PTX kernel

Problems

  • std must be compiled with nvptx
  • Compile flow (How to trigger nvptx build instead of proc-macro?)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions