Skip to content

Commit 6d93282

Browse files
Virat AgarwalGitHub Enterprise
authored andcommitted
Updating Host_memory_Copy_kernel examples updated to gracefully exit for u250_gen3x16_xdma_3_1_202020 platforms (#997)
1 parent a9a8139 commit 6d93282

File tree

2 files changed

+19
-0
lines changed
  • host_xrt/host_memory_copy_kernel_xrt/src
  • host/host_memory_copy_kernel/src

2 files changed

+19
-0
lines changed

host/host_memory_copy_kernel/src/host.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ int main(int argc, char* argv[]) {
4545
bool valid_device = false;
4646
for (unsigned int i = 0; i < devices.size(); i++) {
4747
auto device = devices[i];
48+
auto device_name = device.getInfo<CL_DEVICE_NAME>();
49+
if (xcl::is_hw_emulation()) {
50+
if (device_name.find("u250_gen3x16_xdma_3_1_202020") != std::string::npos) {
51+
std::cout << "[INFO]: The example is not supported for u250_gen3x16_xdma_3_1_202020 for hw_emu. Please "
52+
"try other flows."
53+
<< '\n';
54+
return EXIT_SUCCESS;
55+
}
56+
}
4857
// Creating Context and Command Queue for selected Device
4958
OCL_CHECK(err, context = cl::Context(device, nullptr, nullptr, nullptr, &err));
5059
OCL_CHECK(err, q = cl::CommandQueue(context, device, CL_QUEUE_PROFILING_ENABLE, &err));

host_xrt/host_memory_copy_kernel_xrt/src/host.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ int main(int argc, char* argv[]) {
4545

4646
std::cout << "Open the device" << device_index << std::endl;
4747
auto device = xrt::device(device_index);
48+
auto device_name = device.get_info<xrt::info::device::name>();
49+
char* xcl_mode = getenv("XCL_EMULATION_MODE");
50+
if ((xcl_mode != nullptr) && !strcmp(xcl_mode, "hw_emu")) {
51+
if (device_name.find("u250_gen3x16_xdma_3_1_202020") != std::string::npos) {
52+
std::cout << "[INFO]: The example is not supported for u250_gen3x16_xdma_3_1_202020 for hw_emu. Please try "
53+
"other flows."
54+
<< '\n';
55+
return EXIT_SUCCESS;
56+
}
57+
}
4858
std::cout << "Load the xclbin " << binaryFile << std::endl;
4959
auto uuid = device.load_xclbin(binaryFile);
5060

0 commit comments

Comments
 (0)