You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For ext::intel::kernel_readable_io_pipe/ext::intel::kernel_writeable_io_pipe, the ID in the channel_id struct is ignored. If only one read and one write channel are used, the pipes always get mapped to the 0-indexed read or write channel.
The minimal example below should write data to the second QSFP Port and should read these values from the first QSFP Port. With the help of our infrastructure, these two ports are linked to each other. So it is expected that read_chanel_id is mapped to the chan_id "kernel_input_ch1" and write_channel_id is mapped to the chan_id "kernel_output_ch0"
It worked for oneAPI version until 2023.1, but this does not work for newer ones anymore.
Since version 2023.2, it does not matter which ID is declared in the struct, but the read_chanel_id is mapped to kernel_input_ch0, and write_channel_id is mapped to kernel_output_ch0. In this case, we always get a loop back on the first port.
If there is more than one read / one write declared in the code, the mapping gets somehow random.
To reproduce
Minimal Example:
#include<sycl/sycl.hpp>
#include<sycl/ext/intel/fpga_extensions.hpp>
#include<iostream>
#include<vector>usingnamespacesycl;// Vector size for this exampleconstexprsize_tkSize = 1024;
classVectorAdd;
structread_channel_id {
staticconstexprunsigned id = 2;
};
structwrite_channel_id {
staticconstexprunsigned id = 1;
};
structchannel_data {
int data[8];
};
using read_channel = ext::intel::kernel_readable_io_pipe<read_channel_id, channel_data, 8>;
using write_channel = ext::intel::kernel_writeable_io_pipe<write_channel_id, channel_data, 8>;
intmain() {
std::vector<int> vec_a(kSize), vec_b(kSize), vec_r(kSize);
for (int i = 0; i < kSize; i++) {
vec_a[i] = rand();
vec_b[i] = rand();
}
#if defined(FPGA_EMULATOR)
auto device_selector = ext::intel::fpga_emulator_selector_v;
#elseauto device_selector = ext::intel::fpga_selector_v;
#endiftry {
queue q(device_selector);
std::cout << "Running on device: "
<< q.get_device().get_info<info::device::name>() << "\n";
{
buffer buf_a(vec_a);
buffer buf_b(vec_b);
buffer buf_r(vec_r);
q.submit([&](handler& h) {
accessor a(buf_a, h, read_only);
accessor b(buf_b, h, read_only);
accessor r(buf_r, h, write_only, no_init);
h.single_task<VectorAdd>([=]() [[intel::kernel_args_restrict]] {
for (int i = 0; i < kSize/8; ++i) {
channel_data write_data;
for (int j=0; j < 8; j++) {
write_data.data[j] = a[i*8 + j] + b[i*8 + j];
}
write_channel::write(write_data);
channel_data read_data = read_channel::read();
for (int j=0; j < 8; j++) {
r[i*8 + j] = read_data.data[j];
}
}
});
});
}
}
catch (sycl::exceptionconst& e) {
// Catches exceptions in the host code
std::cerr << "Caught a SYCL host exception:\n" << e.what() << "\n";
// Most likely the runtime couldn't find FPGA hardware!if (e.code().value() == CL_DEVICE_NOT_FOUND) {
std::cerr << "If you are targeting an FPGA, please ensure that your ""system has a correctly configured FPGA board.\n";
std::cerr << "Run sys_check in the oneAPI root directory to verify.\n";
std::cerr << "If you are targeting the FPGA emulator, compile with ""-DFPGA_EMULATOR.\n";
}
std::terminate();
}
// Check the results.int correct = 0;
for (int i = 0; i < kSize; i++) {
if ( vec_r[i] == vec_a[i] + vec_b[i] ) {
correct++;
}
}
// Summarize and return.if (correct == kSize) {
std::cout << "PASSED: results are correct\n";
} else {
std::cout << "FAILED: results are incorrect\n";
}
return !(correct == kSize);
}
Specify the command which should be used to compile the program
Indicate what is wrong and what was expected
For oneAPI 2023.1 the read_channel_id gets mapped to chan_id="kernel_input_1" according to the minimal_example.report.bc.xml
Describe the bug
For
ext::intel::kernel_readable_io_pipe
/ext::intel::kernel_writeable_io_pipe
, the ID in the channel_id struct is ignored. If only one read and one write channel are used, the pipes always get mapped to the 0-indexed read or write channel.The minimal example below should write data to the second QSFP Port and should read these values from the first QSFP Port. With the help of our infrastructure, these two ports are linked to each other. So it is expected that
read_chanel_id
is mapped to the chan_id "kernel_input_ch1" andwrite_channel_id
is mapped to the chan_id "kernel_output_ch0"It worked for oneAPI version until 2023.1, but this does not work for newer ones anymore.
Since version 2023.2, it does not matter which ID is declared in the struct, but the read_chanel_id is mapped to
kernel_input_ch0
, andwrite_channel_id
is mapped tokernel_output_ch0
. In this case, we always get a loop back on the first port.If there is more than one read / one write declared in the code, the mapping gets somehow random.
To reproduce
For oneAPI 2023.1 the
read_channel_id
gets mapped tochan_id="kernel_input_1"
according to theminimal_example.report.bc.xml
While for oneAPI 2024.0 (and all later versions) it gets mapped to
chan_id="kernel_input_0"
Environment
The channel section of the
board_spec.xml
looks like thisAdditional context
No response
The text was updated successfully, but these errors were encountered: