Visible to Intel only — GUID: GUID-650930F1-4976-4CAE-8569-014D36ECF8D4
Visible to Intel only — GUID: GUID-650930F1-4976-4CAE-8569-014D36ECF8D4
DPCT1027
Message
The call to <API name> was replaced with 0 because <reason>.
Detailed Help
API calls from the original application, which do not have functionally compatible SYCL* API calls are replaced with 0 if Intel® DPC++ Compatibility Tool determines that this call removal should not affect the program logic and at the same time the return value of that call is used for error handling.
Possible reasons for replacement:
SYCL currently does not support setting resource limits on devices.
SYCL currently does not support associating USM with a specific queue.
SYCL currently does not support query operations on queues.
SYCL currently does not support capture operations on queues.
SYCL currently does not support configuring shared memory on devices.
SYCL currently does not support setting cache config on devices.
SYCL currently does not support registering of existing host memory for use by device. Use USM to allocate memory for use by host and device.
SYCL currently does not support setting flags for devices.
SYCL currently does not support memory access across peer devices.
There is no corresponding API in SYCL.
The call is redundant in SYCL.
Suggestions to Fix
Verify the code correctness.
For example, this original CUDA* code:
__global__ void kernel() {
return;
}
void foo() {
int err = 0;
cudaLimit limit;
cudaStream_t stream;
unsigned int flags;
cudaSharedMemConfig config;
err = cudaDeviceSetLimit(limit, 0);
err = cudaStreamAttachMemAsync(stream, nullptr);
err = cudaStreamQuery(stream);
err = cudaStreamBeginCapture(stream, cudaStreamCaptureModeGlobal);
err = cudaDeviceSetSharedMemConfig(config);
err = cudaDeviceSetCacheConfig(cudaFuncCachePreferNone);
err = cuMemHostRegister(ptr, count, flags);
err = cudaSetDeviceFlags(flags);
err = cudaDeviceEnablePeerAccess(peer_device, flags);
err = cuInit(0);
float *aptr;
cudaStreamAttrValue stream_attribute = {};
stream_attribute.accessPolicyWindow.base_ptr = aptr;
stream_attribute.accessPolicyWindow.num_bytes = 8 * 8 * 8;
stream_attribute.accessPolicyWindow.hitRatio = 1.0f;
stream_attribute.accessPolicyWindow.hitProp = cudaAccessPropertyPersisting;
stream_attribute.accessPolicyWindow.missProp = cudaAccessPropertyStreaming;
err = cudaStreamSetAttribute(stream, cudaStreamAttributeAccessPolicyWindow, &stream_attribute);
err = cudaStreamGetAttribute(stream, cudaStreamAttributeAccessPolicyWindow, &stream_attribute);
err = cudaCtxResetPersistingL2Cache();
err = cuCtxResetPersistingL2Cache();
err = cudaFuncSetAttribute(kernel, cudaFuncAttributeMaxDynamicSharedMemorySize, 8 * 8 * 8);
}
results in the following migrated SYCL code:
void kernel() {
return;
}
void foo() try {
int err = 0;
cudaLimit limit;
dpct::queue_ptr stream;
unsigned int flags;
int config;
/*
DPCT1027:0: The call to cudaDeviceSetLimit was replaced with 0 because SYCL
currently does not support setting resource limits on devices.
*/
err = 0;
/*
DPCT1027:1: The call to cudaStreamAttachMemAsync was replaced with 0 because
SYCL currently does not support associating USM with a specific queue.
*/
err = 0;
/*
DPCT1027:2: The call to cudaStreamQuery was replaced with 0 because SYCL
currently does not support query operations on queues.
*/
err = 0;
/*
DPCT1027:3: The call to cudaDeviceSetSharedMemConfig was replaced with 0
because SYCL currently does not support configuring shared memory on devices.
*/
err = 0;
/*
DPCT1027:4: The call to cudaDeviceSetCacheConfig was replaced with 0 because
SYCL currently does not support setting cache config on devices.
*/
err = 0;
/*
DPCT1027:5: The call to cudaSetDeviceFlags was replaced with 0 because SYCL
currently does not support setting flags for devices.
*/
err = 0;
/*
DPCT1027:6: The call to cuInit was replaced with 0 because this call is
redundant in SYCL.
*/
err = 0;
float *aptr;
/*
DPCT1007:7: Migration of cudaStreamAttributeValue is not supported.
*/
cudaStreamAttrValue stream_attribute = {};
/*
DPCT1027:8: The call to cudaStreamSetAttribute was removed because SYCL currently
does not support setting cache config on devices.
*/
err = 0;
/*
DPCT1027:9: The call to cudaStreamGetAttribute was removed because SYCL currently
does not support setting cache config on devices.
*/
err = 0;
/*
DPCT1027:10: The call to cudaCtxResetPersistingL2Cache was removed because SYCL
currently does not support setting cache config on devices.
*/
err = 0;
/*
DPCT1027:11: The call to cuCtxResetPersistingL2Cache was removed because SYCL
currently does not support setting cache config on devices.
*/
err = 0;
/*
DPCT1027:12: The call to cudaFuncSetAttribute was removed because SYCL currently
does not support corresponding setting.
*/
err = 0;
/*
DPCT1027:13: The call to cudaFuncSetAttribute was removed because SYCL currently
does not support corresponding setting.
*/
err = 0;
}
catch (sycl::exception const &exc) {
std::cerr << exc.what() << "Exception caught at file:" << __FILE__
<< ", line:" << __LINE__ << std::endl;
std::exit(1);
}
which is rewritten to:
void foo() {
int err = 0;
cudaLimit limit;
dpct::queue_ptr stream;
unsigned int flags;
int config;
float *aptr;
}