Public Member Functions | Static Public Attributes | List of all members
ML::HandleMap Class Reference

#include <cumlHandle.hpp>

Collaboration diagram for ML::HandleMap:
Collaboration graph

Public Member Functions

std::pair< cumlHandle_t, cumlError_tcreateAndInsertHandle (cudaStream_t stream)
 Creates new handle object with associated handle ID and insert into map. More...
 
std::pair< raft::handle_t *, cumlError_tlookupHandlePointer (cumlHandle_t handle) const
 Lookup pointer to handle object for handle ID in map. More...
 
cumlError_t removeAndDestroyHandle (cumlHandle_t handle)
 Remove handle from map and destroy associated handle object. More...
 

Static Public Attributes

static const cumlHandle_t INVALID_HANDLE = -1
 sentinel value for invalid ID More...
 

Detailed Description

Map from integral cumlHandle_t identifiers to cumlHandle pointer protected by a mutex for thread-safe access.

Member Function Documentation

◆ createAndInsertHandle()

std::pair< cumlHandle_t, cumlError_t > ML::HandleMap::createAndInsertHandle ( cudaStream_t  stream)

Creates new handle object with associated handle ID and insert into map.

Parameters
[in]streamthe stream to which cuML work should be ordered.
Returns
std::pair with handle and error code. If error code is not CUML_SUCCESS the handle is INVALID_HANDLE.

◆ lookupHandlePointer()

std::pair< raft::handle_t *, cumlError_t > ML::HandleMap::lookupHandlePointer ( cumlHandle_t  handle) const

Lookup pointer to handle object for handle ID in map.

Returns
std::pair with handle and error code. If error code is not CUML_SUCCESS the handle is INVALID_HANDLE. Error code CUML_INAVLID_HANDLE is returned if the provided handle is invalid.

◆ removeAndDestroyHandle()

cumlError_t ML::HandleMap::removeAndDestroyHandle ( cumlHandle_t  handle)

Remove handle from map and destroy associated handle object.

Returns
cumlError_t CUML_SUCCESS or CUML_INVALID_HANDLE. Error code CUML_INAVLID_HANDLE is returned if the provided handle is invalid.

Member Data Documentation

◆ INVALID_HANDLE

const cumlHandle_t ML::HandleMap::INVALID_HANDLE = -1
static

sentinel value for invalid ID


The documentation for this class was generated from the following files: