不能操作workspace,errorStr: When the D-cache reads and writes data to the UB, the response value returned by the bus is a no
已解决发表于2024-11-26 16:49:48
0 查看
平台:
modelarts cann 8.0rc3 新建的工程
tiling
kernel
算子运行报错
plog
errorStr: When the D-cache reads and writes data to the UB, the response value returned by the bus is a non-zero value.
按照提示说明是内存越界了,但是我的代码里只是访问了workspace的第一值。 有人知道这是什么问题吗?
本帖最后由 匿名用户 于 2024/11/26 18:50:27 编辑
平台:
modelarts cann 8.0rc3 新建的工程
tiling
static ge::graphStatus TilingFunc(gert::TilingContext* context) { TestTilingData tiling; context->SetBlockDim(1); size_t *currentWorkspace = context->GetWorkspaceSizes(1); currentWorkspace[0] = 1024; tiling.SaveToBuffer(context->GetRawTilingData()->GetData(), context->GetRawTilingData()->GetCapacity()); context->GetRawTilingData()->SetDataSize(tiling.GetDataSize()); return ge::GRAPH_SUCCESS; } }kernel
#include "kernel_operator.h" using namespace AscendC; extern "C" __global__ __aicore__ void test(GM_ADDR x, GM_ADDR y, GM_ADDR workspace, GM_ADDR tiling) { GET_TILING_DATA(tiling_data, tiling); GlobalTensor<int32_t> w; auto wptr = GetUserWorkspace(workspace); w.SetGlobalBuffer((__gm__ int32_t*)wptr); w(0) = int32_t(1); }算子运行报错
plog
errorStr: When the D-cache reads and writes data to the UB, the response value returned by the bus is a non-zero value.
按照提示说明是内存越界了,但是我的代码里只是访问了workspace的第一值。 有人知道这是什么问题吗?