-
Notifications
You must be signed in to change notification settings - Fork 70
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
Perform a memory copy for simulation buffer with buffer location #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sophimao! This change needs a unit test. You can check the existing tests to see if there is anything that could be used as a starting point.
Sorry can you elaborate more on this? I believe if we want to test the simulation flow we would need to replace the unit test environment variable from
I think we probably have to go with the former since creating a context with the property doesn't make other runtime constructs aware that we are running simulation flow. Or is there another way we can do this without having to involve the CL_CONTEXT_* environment variables? |
Ideally the unit test directly invokes Regarding environment variables, |
Thanks Peter! I managed to add a unit test by faking a device with multiple global memories. Let me know if there is anything else I should address 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sophimao, looks good with the unit test! After addressing the minor comments, could you squash everything into a single commit? Then this is ready to be merged 🙂
f4c11e2
to
00d6fb5
Compare
…al memory address range
00d6fb5
to
60b2651
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sophimao! Please go ahead with merging once the CI has passed.
As simulator does not have any global memory interface information before reprogram, change #104 initializes the runtime device def to have
ACL_MAX_GLOBAL_MEM
global memories, each with the same global memory address range obtained from a predefined default autodiscovery string (see #104 for details).This becomes an issue when a buffer is created with the buffer location property specifying a global memory whose address range beginning lies beyond the range defined in the default autodiscovery string, and is written before the device reprogram. The write will send the data to address range specified by the default autodiscovery string, however, the kernel will check for the data in the actual address range specified by the device specification file (ipinterfaces.xml) and find nothing in that location.
This change tries to detect the above situation, and force a memory copy from the incorrect address range to the actual global memory address range before launching the kernel, so that correct results can be ensured.