Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple accessor to the same buffer with different ddr_bank property doesn't work #135

Open
lforg37 opened this issue Sep 16, 2021 · 1 comment
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@lforg37
Copy link
Contributor

lforg37 commented Sep 16, 2021

When running a program with multiple kernels having arguments mapped on different DDR bank the program fail due to buffer allocated on wrong DDR bank.

To Reproduce
Run the sycl/test/on-device/xocc/simple_tests/ddr_bank_test.cpp test.

// RUN: %clangxx -fsycl -std=c++20 -fsycl-targets=%sycl_triple %s -o %t.out 2>&1 | FileCheck %s
// RUN: %ACC_RUN_PLACEHOLDER %t.out

#include <sycl/sycl.hpp>
#include <sycl/ext/xilinx/fpga.hpp>

int main() {
  cl::sycl::buffer<cl::sycl::cl_int, 1> Buffer(4);
  cl::sycl::queue Queue;
  const cl::sycl::cl_int buf_size = Buffer.size();

  Queue.submit([&](cl::sycl::handler &cgh) {
    sycl::ext::oneapi::accessor_property_list PL{sycl::ext::xilinx::ddr_bank<1>};
    // CHECK:{{.*}}:DDR[1]
    sycl::accessor Accessor(Buffer, cgh, sycl::write_only, PL);
    cgh.single_task<class SmallerTesta>([=]{
          for (cl::sycl::cl_int i = 0 ; i < buf_size ; ++i)
            Accessor[i] = i;
        });
  });
  Queue.submit([&](cl::sycl::handler &cgh) {
    sycl::ext::oneapi::accessor_property_list PL{sycl::ext::xilinx::ddr_bank<3>};
    // CHECK:{{.*}}:DDR[3]
    sycl::accessor Accessor(Buffer, cgh, sycl::write_only, PL);
    cgh.single_task<class SmallerTestb>([=]{
          for (cl::sycl::cl_int i = 0 ; i < buf_size ; ++i)
            Accessor[i] = i;
        });
  });
  Queue.submit([&](cl::sycl::handler &cgh) {
    sycl::ext::oneapi::accessor_property_list PL{sycl::ext::xilinx::ddr_bank<0>};
    // CHECK:{{.*}}:DDR[0]
    sycl::accessor Accessor(Buffer, cgh, sycl::write_only, PL);
    cgh.single_task<class SmallerTestc>([=]{
          for (cl::sycl::cl_int i = 0 ; i < buf_size ; ++i)
            Accessor[i] = i;
        });
  });
}

There is only one buffer created on the device, where three copies are required : one on each target ddr bank.

@lforg37 lforg37 added the bug Something isn't working label Sep 16, 2021
@lforg37 lforg37 self-assigned this Sep 16, 2021
@lforg37 lforg37 changed the title XRT memory bank deduction fail with multi kernel programs Multiple accessor to the same buffer with different ddr_bank property doesn't work Sep 21, 2021
@lforg37
Copy link
Contributor Author

lforg37 commented Sep 23, 2021

Opening a discussion on intel repo to compare with what is done for their intel::property::buffer_location property.

@lforg37 lforg37 added enhancement New feature or request bug Something isn't working and removed bug Something isn't working labels Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant