Forum Discussion
Altera_Forum
Honored Contributor
8 years agoThe soc driver has a call to return physical address for a virtual one (but only for virtual addresses that are start of shared opencl buffers). The function you're looking for is aclsoc_exec_cmd, with ACLSOC_CMD_GET_PHYS_FROM_VIRT command. You call this function by doing a read in your user space program with special parameters. See shared_mem_alloc in acl_mmd_device.cpp that came with the board. I hope you will figure out how to call the read from your program.
--- Quote Start --- I wanted to follow up on this (hopefully someone might see it...) We have a SGDMA engine driving data (from a camera) into DDR, that we'd then like to feed to an OpenCL kernel. We are currently programming the SGDMA engine in user space, but even if we wrote a driver we don't have the correct mapping to hand it. Right now, because the OpenCL API does not provide a physical address pointer, we have to copy data SGDMA'd from one buffer to an allocated buffer from OpenCL. This seems extremely wasteful and defeats the purpose of using OpenCL. How do recommend we accomplish this? --- Quote End ---