-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/bench: add support for device memory
Add device memory support using mtest_common utilities. This will add the dependency to utitlity libraries, which the makefile already imports. However, this will remove the simpliicity of building single source with mpicc or mydef_run. If one doesn't need test device memory, one can simply comment off "$include macros/mtest.def" to restore the simplicity.
- Loading branch information
Showing
4 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
macros: | ||
HAS_MTEST: 1 | ||
|
||
subcode: mtest_malloc(size) | ||
MTestArgList *head = MTestArgListCreate(argc, argv) | ||
int send_rank = 0, recv_rank = 1; | ||
$(for:a in send,recv) | ||
$if grank == $(a)_rank | ||
$my mtest_mem_type_e $(a)_memtype, int $(a)_device | ||
$(a)_memtype = MTestArgListGetMemType(head, "$(a)mem") | ||
$(a)_device = MTestArgListGetInt_with_default(head, "$(a)dev", 0) | ||
MTestMalloc($(size), $(a)_memtype, NULL, &buf, $(a)_device) | ||
MTestPrintfMsg(1, "Allocating buffer: memtype=%s, device=%d, size=%d\n", MTest_memtype_name($(a)_memtype), $(a)_device, $(size)) | ||
MTestArgListDestroy(head) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters