Visible to Intel only — GUID: GUID-E973F281-3132-4D3D-B7D8-EE8D10C00503
Visible to Intel only — GUID: GUID-E973F281-3132-4D3D-B7D8-EE8D10C00503
DPCT1070
Message
<pointer variable name> is allocated by dpct::dpct_malloc. Use dpct::get_host_ptr<type>(pointer variable name) to access the pointer from the host code.
Detailed Help
The memory referenced by this pointer is allocated by dpct::dpct_malloc and cannot be directly accessed from the host code. You can access the memory from the host code by transforming the pointer using the dpct::get_host_ptr function.
Suggestions to Fix
Re-migrate the code without specifing --usm-level=none; or
Review the code and adjust it manually.
For example, this original CUDA* code:
void bar(float *a) {
a[0] = 1;
}
void foo() {
float* a;
cudaMallocManaged(&a, 10 * sizeof(float));
bar(a);
}
results in the following migrated SYCL* code:
#define DPCT_USM_LEVEL_NONE
#include <sycl/sycl.hpp>
#include <dpct/dpct.hpp>
void bar(float *a) {
a[0] = 1;
}
void foo() {
float* a;
/*
DPCT1070:0: 'a' is allocated by dpct::dpct_malloc. Use
dpct::get_host_ptr<float>(a) to access the pointer from the host code.
*/
a = (float *)dpct::dpct_malloc(10 * sizeof(float));
bar(a);
}
which is rewritten to:
#define DPCT_USM_LEVEL_NONE
#include <sycl/sycl.hpp>
#include <dpct/dpct.hpp>
void bar(float *a) {
dpct::get_host_ptr<float>(a)[0] = 1;
}
void foo() {
float* a;
a = (float *)dpct::dpct_malloc(10 * sizeof(float));
bar(a);
}