@@ -409,7 +409,8 @@ __global__ void __launch_bounds__(512, 1) ibgda_progress_send_kernel(
409409 std::size_t totalBytes,
410410 int numBlocks,
411411 std::size_t maxSignalBytes,
412- Timeout timeout) {
412+ Timeout timeout,
413+ bool waitForSlotFree) {
413414 auto group = make_block_group ();
414415
415416 const std::size_t sectionBytes = section_bytes (transport, totalBytes);
@@ -423,6 +424,50 @@ __global__ void __launch_bounds__(512, 1) ibgda_progress_send_kernel(
423424 IbgdaSendRecvProgressStatus::Done) {
424425 }
425426 }
427+
428+ if (waitForSlotFree) {
429+ auto & channel = transport->local_channel (group.group_id );
430+ transport->wait_signal (
431+ group,
432+ channel.slotFree ,
433+ static_cast <uint64_t >(channel.sendProgress .nextStep ),
434+ timeout);
435+ }
436+ }
437+
438+ __global__ void __launch_bounds__ (512 , 1 ) ibgda_registered_progress_send_kernel(
439+ P2pIbgdaTransportDevice* transport,
440+ IbgdaLocalBuffer src,
441+ std::size_t totalBytes,
442+ int numBlocks,
443+ std::size_t maxSignalBytes,
444+ Timeout timeout) {
445+ auto group = make_block_group ();
446+
447+ auto status = IbgdaRegisteredSendProgressStatus::Waiting;
448+ const std::size_t sectionBytes = section_bytes (transport, totalBytes);
449+ const std::size_t totalSections = totalBytes / sectionBytes;
450+ for (std::size_t s = 0 ; s < totalSections; ++s) {
451+ const auto section = src.subBuffer (s * sectionBytes);
452+ transport->init_registered_send_progress (
453+ group, sectionBytes, maxSignalBytes);
454+ status = IbgdaRegisteredSendProgressStatus::Waiting;
455+ while (status != IbgdaRegisteredSendProgressStatus::Posted &&
456+ status != IbgdaRegisteredSendProgressStatus::Drained) {
457+ status = transport->progress_registered_send_once (
458+ group, section, sectionBytes, maxSignalBytes, timeout);
459+ }
460+ }
461+ while (status != IbgdaRegisteredSendProgressStatus::Drained) {
462+ status = transport->progress_registered_send_drain_once (group, timeout);
463+ }
464+
465+ auto & channel = transport->local_channel (group.group_id );
466+ transport->wait_signal (
467+ group,
468+ channel.slotFree ,
469+ static_cast <uint64_t >(channel.sendProgress .nextStep ),
470+ timeout);
426471}
427472
428473__global__ void __launch_bounds__ (512 , 1 ) ibgda_progress_recv_kernel(
@@ -467,7 +512,36 @@ void launch_ibgda_progress_send(
467512 printf (" [PIPES] progress send benchmark is NVIDIA-only\n " );
468513#else
469514 ibgda_progress_send_kernel<<<numBlocks, 512 , 0 , stream>>> (
470- transport, src, nbytes, numBlocks, maxSignalBytes, timeout);
515+ transport, src, nbytes, numBlocks, maxSignalBytes, timeout, false );
516+ cudaError_t err = cudaGetLastError ();
517+ if (err != cudaSuccess) {
518+ printf (
519+ " [PIPES] progress send kernel launch failed: %s\n " ,
520+ cudaGetErrorString (err));
521+ }
522+ #endif
523+ }
524+
525+ void launch_ibgda_progress_send_complete (
526+ P2pIbgdaTransportDevice* transport,
527+ char * src,
528+ std::size_t nbytes,
529+ int numBlocks,
530+ cudaStream_t stream,
531+ std::size_t maxSignalBytes,
532+ Timeout timeout) {
533+ #ifdef __HIP_PLATFORM_AMD__
534+ (void )transport;
535+ (void )src;
536+ (void )nbytes;
537+ (void )numBlocks;
538+ (void )stream;
539+ (void )maxSignalBytes;
540+ (void )timeout;
541+ printf (" [PIPES] progress send benchmark is NVIDIA-only\n " );
542+ #else
543+ ibgda_progress_send_kernel<<<numBlocks, 512 , 0 , stream>>> (
544+ transport, src, nbytes, numBlocks, maxSignalBytes, timeout, true );
471545 cudaError_t err = cudaGetLastError ();
472546 if (err != cudaSuccess) {
473547 printf (
@@ -477,6 +551,35 @@ void launch_ibgda_progress_send(
477551#endif
478552}
479553
554+ void launch_ibgda_registered_progress_send (
555+ P2pIbgdaTransportDevice* transport,
556+ const IbgdaLocalBuffer& src,
557+ std::size_t nbytes,
558+ int numBlocks,
559+ cudaStream_t stream,
560+ std::size_t maxSignalBytes,
561+ Timeout timeout) {
562+ #ifdef __HIP_PLATFORM_AMD__
563+ (void )transport;
564+ (void )src;
565+ (void )nbytes;
566+ (void )numBlocks;
567+ (void )stream;
568+ (void )maxSignalBytes;
569+ (void )timeout;
570+ printf (" [PIPES] registered progress send benchmark is NVIDIA-only\n " );
571+ #else
572+ ibgda_registered_progress_send_kernel<<<numBlocks, 512 , 0 , stream>>> (
573+ transport, src, nbytes, numBlocks, maxSignalBytes, timeout);
574+ cudaError_t err = cudaGetLastError ();
575+ if (err != cudaSuccess) {
576+ printf (
577+ " [PIPES] registered progress send kernel launch failed: %s\n " ,
578+ cudaGetErrorString (err));
579+ }
580+ #endif
581+ }
582+
480583void launch_ibgda_progress_recv (
481584 P2pIbgdaTransportDevice* transport,
482585 char * dst,
0 commit comments