Hello,
I am working on a simple program that creates GPU segments and performs simply put and get operations.
First, I developed a CPU version using gex_Segment_Attach() function which does not require explicit memory allocation by the user. This function internally allocates memory and returns the segment handle where I can obtain the pointer using gex_Segment_QueryAddr(). I can use the pointer for put and get operations.
Now I am trying to do the same with CUDA memory kind. As far as I know, I should use gex_Segment_Create() function to create segments that lives in GPUs.
int gex_Segment_Create(
gex_Segment_t *segment_p, // OUT
gex_Client_t client,
gex_Addr_t address,
uintptr_t length,
gex_MK_t kind,
gex_Flags_t flags);
// Valid flags:
// NONE - zero is currently required
I wonder what the third argument means. Is it a pointer to a device buffer that is allocated by the user (i.e., using cudaMalloc())?
If so, I have to set device myself, using cudaSetDevice(), right? Also, should the allocation size match with the fourth argument and should it be a multiple GASNET_PAGESIZE? In this case, gex_Segment_QueryAddr() becomes redundant unless the user loses the pointer to the device buffer, is that right?
Best regareds,
Mert
--
You received this message because you are subscribed to the Google Groups "gasnet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gasnet-users...@lbl.gov.
To view this discussion on the web visit https://groups.google.com/a/lbl.gov/d/msgid/gasnet-users/SJ0PR02MB73579CDC9E023A1BF6AD12A8D1EB2%40SJ0PR02MB7357.namprd02.prod.outlook.com.
Thanks, Paul!
I also included gex_EP_BindSegment() and gex_EP_PublishBoundSegment().
extern int gex_EP_PublishBoundSegment(
gex_TM_t tm,
gex_EP_t *eps, // IN
size_t num_eps,
gex_Flags_t flags);
Above, does *eps represent the endpoint associated with the caller, all endpoints, or only remote endpoints that I wish to communicate from the caller?
My code currently crashes, and I am not sure this is the right place to paste the code (83 lines). Shall I send you in a separate email?
Best regards,
Mert
Thanks, Paul. That’s what I thought!
I am still getting an error message. Just to be kind to other readers, I followed up the conversation at gasnet...@lbl.gov.
Thanks for your help.