coreylowman / cudarc

Safe rust wrapper around CUDA toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to save compiled ptx?

soloist-v opened this issue · comments

let ptx = cudarc::nvrtc::compile_ptx("
extern \"C\" __global__ void sin_kernel(float *out, const float *inp, const size_t numel) {
    unsigned int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < numel) {
        out[i] = sin(inp[i]);
    }
}").unwrap();

How to save the compiled ptx?

@soloist-v We can add a Into<String> method or something like that to extract the source. Would that be sufficient? Then users could save the source however they want.

Great ! I think adding an 'Into' method to extract the source sounds like a great idea. It would provide users with the flexibility to save the source in their preferred format.