denzp / rust-ptx-linker

The missing puzzle piece for NVPTX experience with Rust
MIT License
52 stars 11 forks source link

Error compiling kernel code for the host #16

Closed bheisler closed 6 years ago

bheisler commented 6 years ago

If the user mistakenly attempts to compile kernel code for the host, an unclear LLVM error is printed:

LLVM ERROR: Cannot select: intrinsic %llvm.nvvm.read.ptx.sreg.nctaid.x
error: Could not compile `chapter-1-kernel`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Perhaps there is some way to detect this and display a better error message.

denzp commented 6 years ago

Thanks! I added the error message in chapter-1 device crate.

Sadly it can only be done manually in device crate code. No ptx-linker or ptx-builder are involved in this case.