-
Notifications
You must be signed in to change notification settings - Fork 108
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
add unit test and modify map_to_peer api #21
Conversation
@@ -19,7 +19,7 @@ struct AmPointerInfo { | |||
void * _hostPointer; ///< Host pointer. If host access is not allowed, NULL. | |||
void * _devicePointer; ///< Device pointer. | |||
size_t _sizeBytes; ///< Size of allocation. | |||
hc::accelerator &_acc; ///< Device / Accelerator to use. |
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.
@facao and @bensander . after our discussion I think it's better to change this field to hc::accelerator* , instead of hc::accelerator& (so we don't have undefined semantic), or hc::accelerator (so we save memory).
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.
As @facao pointed out, hc::accelerator is just a wrapper of KalmarDevice* , and I've verified that sizeof(hc::accelerator) is only 8. So we should be fine copying it around.
@facao Per our discussion I'm for the idea moving to
|
@facao There are conflicts in this pull request. Could you help resolve them so we can adopt this pull request? |
* accelerator is peer of itself. | ||
* FIXME: on current system, dGPU is peer of any each | ||
* other, we should expect is_get_peer() return true. | ||
*/ |
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.
@facao the unit test assume all dGPUs are peers to each other, which may be true for supported configuration. but for systems without P2P support acc.get_is_peer() would return false and this test would fail.
as the result of the test depends on the hardware configuration, and in many cases won't simply work, so I'd propose ways to improve this test case. And I'm more inclined to ask you improve the test as the 2nd method.
- relax this test so as long as long as acc.get_is_peer() could return a valid value, then call the test pass. this would reduce the test case to merely check whether the API is available in the header file.
- change the test case, and use HSA runtime API to query if the hardware do have HSA agents who are peers, and then check if the result of acc.get_is_peer() agree with it. You can refer to the following unit test as an example:
No description provided.