mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	 e7e5202978
			
		
	
	
		e7e5202978
		
			
		
	
	
	
	
		
			
			The amdgpu-kernel calling convention was reverted in commit f6b21e90d1ec01081bc2619efb68af6788a63d65 due to inactivity in the amdgpu target. Introduce a `gpu-kernel` calling convention that translates to `ptx_kernel` or `amdgpu_kernel`, depending on the target that rust compiles for.
		
			
				
	
	
		
			19 lines
		
	
	
		
			495 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			495 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Checks that the gpu-kernel calling convention correctly translates to LLVM calling conventions.
 | |
| 
 | |
| //@ revisions: nvptx
 | |
| //@ [nvptx] compile-flags: --crate-type=rlib --target=nvptx64-nvidia-cuda
 | |
| //@ [nvptx] needs-llvm-components: nvptx
 | |
| #![feature(no_core, lang_items, abi_gpu_kernel)]
 | |
| #![no_core]
 | |
| 
 | |
| #[lang = "sized"]
 | |
| trait Sized {}
 | |
| #[lang = "freeze"]
 | |
| trait Freeze {}
 | |
| #[lang = "copy"]
 | |
| trait Copy {}
 | |
| 
 | |
| // nvptx: define ptx_kernel void @fun(i32
 | |
| #[no_mangle]
 | |
| pub extern "gpu-kernel" fn fun(_: i32) {}
 |