基本原理 使用已有rust cuda库 cust 来调用cuda代码。 将cuda代码编译为.ptx或.fatbin文件 使用cust读取cuda 编译的 .ptx 或者 .fatbin 文件,然后调用其中对应的cuda函数 示例 环境:ubuntu 22.04(rust和cuda要提前安装) 书写gpu hello-world代码 hello.cu #include <stdio.h> #include <cuda_runtime.h> extern "C" __global__ void…
基本原理 使用已有rust cuda库 cust 来调用cuda代码。 将cuda代码编译为.ptx或.fatbin文件 使用cust读取cuda 编译的 .ptx 或者 .fatbin 文件,然后调用其中对应的cuda函数 示例 环境:ubuntu 22.04(rust和cuda要提前安装) 书写gpu hello-world代码 hello.cu #include <stdio.h> #include <cuda_runtime.h> extern "C" __global__ void…