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 the XDMA driver, how to write non-contiguous memory blocks on the HOST side into an SG list (multiple table entries), and then write them to the FPGA through the XDMA driver?
#297
Open
robert987-dev opened this issue
Oct 8, 2024
· 0 comments
For the XDMA driver, how to write non-contiguous memory blocks on the HOST side into an SG list (multiple table entries), and then write them to the FPGA through the XDMA driver?
For example, I allocate non-contiguous memory blocks on the host side:
// Total data sizesize_t total_size = STREAM_SIZE * SEQUENCE_NUMBER * BATCH_SIZE * sizeof(float);
size_t num_blocks = total_size / BLOCK_SIZE; // Total number of blocksprintf("num_blocks: %d \n", num_blocks);
// Allocate an array to store block pointers
hostDataBlocks = (float**)malloc(num_blocks * sizeof(float*));
if (!hostDataBlocks) {
perror("malloc");
return -1;
}
// Allocate non-contiguous memory blocksfor (size_t i = 0; i < num_blocks; ++i) {
cudaStatus = cudaHostAlloc((void**)&hostDataBlocks[i], BLOCK_SIZE, cudaHostAllocDefault);
if (cudaStatus != cudaSuccess) {
std::cerr << "cudaHostAlloc failed: " << cudaGetErrorString(cudaStatus) << std::endl;
return -1;
}
}
How to use the XDMA driver to write hostDataBlocks into the DMA using SG mode?
The text was updated successfully, but these errors were encountered:
For the XDMA driver, how to write non-contiguous memory blocks on the HOST side into an SG list (multiple table entries), and then write them to the FPGA through the XDMA driver?
For example, I allocate non-contiguous memory blocks on the host side:
How to use the XDMA driver to write
hostDataBlocks
into the DMA using SG mode?The text was updated successfully, but these errors were encountered: