cuobjclient

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

This file holds the S3 request plumbing shared by the GPU (session_linux.go) and host-memory (session_host_linux.go) session implementations: both issue a zero-byte PUT/GET carrying the cuObject RDMA descriptor headers, and let the gateway perform the actual transfer via RDMA.

Index

Constants

View Source
const MaxTransferSize = 1 << 30

MaxTransferSize is the largest transfer size supported by the cuObject client path in this package.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session owns a CUDA buffer registered for cuObject RDMA token exchange.

func NewSession

func NewSession(size int) (*Session, error)

NewSession creates a GPU-backed cuObject session for a fixed transfer size. The returned session allocates CUDA memory, registers the descriptor with cuobjclient, and prepares RDMA token generation for Upload and Download. size must be in the range [1, MaxTransferSize]. A Session is reusable for multiple transfers as long as each Upload or Download uses buffers with length equal to the size passed to NewSession. Callers should keep a session open for repeated sequential operations and call Close once the session is no longer needed. Session methods are not safe for concurrent use. Do not call Upload, Download, or Close from multiple goroutines at the same time on the same Session value. Call Close when finished to release all resources.

func (*Session) Close

func (s *Session) Close()

Close releases the GPU buffer and destroys the cuObject client context. After Close returns, the Session must not be used.

func (*Session) Download

func (s *Session) Download(base *s3lib.Client, bucket, key string, dst []byte) error

Download performs a GET operation into the session GPU buffer and copies the resulting bytes back into dst. dst length must exactly match the size passed to NewSession.

func (*Session) Upload

func (s *Session) Upload(base *s3lib.Client, bucket, key string, src []byte) error

Upload copies src into the session GPU buffer and performs a PUT operation using cuObject RDMA headers. src length must exactly match the size passed to NewSession.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL