0
点赞
收藏
分享

微信扫一扫

UnLua访问C++属性、动态生成Actor

phpworkerman 2024-09-20 阅读 6

一 代码

需要注意的是在cuda中,二维指针的用法和一维的不同,需要增加一个转换的过程


// #include<torch.h>
#include<stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>


template <typename T>
__global__ void my_index_put_kernel(T** src,
                            int * idx, int  row_idx,
                           T**  value,
                            T** dst, bool accumulate) {
    // if(blockIdx.x == idx)
    printf("hello kernel = %d\n",blockIdx.x);
    printf("test = %d\n",idx[2]);
    printf("src = %lf\n",src[0][0]);
    // for(int i = 0 ; i < row_idx; i ++)
    // {
    //     printf("value = %f\n",value[blockIdx.x][i]);
    //     dst[blo
举报

相关推荐

0 条评论