UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Explorer
Explorer
671 Views
Registered: ‎06-17-2012

memory alignment when allocating emmory in SDAccel

Jump to solution

I have an integer array, but I want to access it with 512bit port in SDAccel. 

But how can I have the memory allocated in device memory to be aligned to 512bit i.e. 64Byte?

I am using xcl_malloc() to do the device memory allocation and seems there is no 

option for aligning the address.

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
626 Views
Registered: ‎03-24-2010

Re: memory alignment when allocating emmory in SDAccel

Jump to solution

Device memory is 4096 bytes aligend.

For host, check example code like 

    size_t vector_size_bytes = sizeof(int) * LENGTH;
    std::vector<int,aligned_allocator<int>> source_a (LENGTH);
    std::vector<int,aligned_allocator<int>> source_b (LENGTH);

in https://github.com/Xilinx/SDAccel_Examples/blob/master/getting_started/misc/vadd/src/host.cpp

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
Xilinx Employee
Xilinx Employee
627 Views
Registered: ‎03-24-2010

Re: memory alignment when allocating emmory in SDAccel

Jump to solution

Device memory is 4096 bytes aligend.

For host, check example code like 

    size_t vector_size_bytes = sizeof(int) * LENGTH;
    std::vector<int,aligned_allocator<int>> source_a (LENGTH);
    std::vector<int,aligned_allocator<int>> source_b (LENGTH);

in https://github.com/Xilinx/SDAccel_Examples/blob/master/getting_started/misc/vadd/src/host.cpp

Regards,
brucey
----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

View solution in original post

0 Kudos