#include <cuda_runtime_api.h>
#include <stddef.h>
Go to the source code of this file.
◆ cuml_allocate
typedef cudaError_t(* cuml_allocate) (void **p, size_t n, cudaStream_t stream) |
◆ cuml_deallocate
typedef cudaError_t(* cuml_deallocate) (void *p, size_t n, cudaStream_t stream) |
◆ cumlError_t
◆ cumlHandle_t
◆ cumlError_t
Enumerator |
---|
CUML_SUCCESS | |
CUML_ERROR_UNKNOWN | |
CUML_INVALID_HANDLE | |
◆ cumlCreate()
Creates a cumlHandle_t.
- Parameters
-
[in,out] | handle | pointer to the handle to create. |
[in] | stream | the stream to which cuML work should be ordered. |
- Returns
- CUML_SUCCESS on success,
- Todo:
- : add more error codes
◆ cumlDestroy()
Release all resource internally managed by cumlHandle_t.
- Parameters
-
[in,out] | handle | the cumlHandle_t to destroy. |
- Returns
- CUML_SUCCESS on success,
- Todo:
- : add more error codes
◆ cumlGetErrorString()
Get a human readable error string for the passed in error code.
- Parameters
-
[in] | error | the error code to decipher. |
- Returns
- a string with a human readable error message.
◆ cumlGetStream()
sets the stream to which all cuML work issued via the passed handle should be ordered.
- Parameters
-
[in,out] | handle | handle to set the stream for. |
[in] | stream | the stream to which cuML work should be ordered. |
- Returns
- CUML_SUCCESS on success,
- Todo:
- : add more error codes
◆ cumlSetDeviceAllocator()
sets the allocator to use for all device allocations done in cuML.
Example use:
cudaError_t device_allocate(void** p,size_t n, cudaStream_t)
{
return cudaMalloc(p,n);
}
cudaError_t device_deallocate(void* p, size_t, cudaStream_t)
{
return cudaFree(p);
}
void foo()
{
}
int cumlHandle_t
Definition: cuml_api.h:37
cumlError_t cumlCreate(cumlHandle_t *handle, cudaStream_t stream)
Creates a cumlHandle_t.
Definition: cuml_api.cpp:37
cumlError_t cumlDestroy(cumlHandle_t handle)
Release all resource internally managed by cumlHandle_t.
Definition: cuml_api.cpp:66
cumlError_t cumlSetDeviceAllocator(cumlHandle_t handle, cuml_allocate allocate_fn, cuml_deallocate deallocate_fn)
sets the allocator to use for all device allocations done in cuML.
- Parameters
-
[in,out] | handle | the cumlHandle_t to set the device allocator for. |
[in] | allocate_fn | function pointer to the allocate function to use for device allocations. |
[in] | deallocate_fn | function pointer to the deallocate function to use for device allocations. |
- Returns
- CUML_SUCCESS on success,
- Todo:
- : add more error codes
◆ cumlSetHostAllocator()
sets the allocator to use for substantial host allocations done in cuML.
Example use:
cudaError_t host_allocate(void** p,size_t n, cudaStream_t)
{
*p = malloc(n);
return NULL != *p ? cudaSuccess : cudaErrorUnknown;
}
cudaError_t host_deallocate(void* p, size_t, cudaStream_t stream)
{
return cudaSuccess;
}
void foo()
{
}
cumlError_t cumlSetHostAllocator(cumlHandle_t handle, cuml_allocate allocate_fn, cuml_deallocate deallocate_fn)
sets the allocator to use for substantial host allocations done in cuML.
void free(const raft::handle_t &h, forest_t< real_t > f)
- Parameters
-
[in,out] | handle | the cumlHandle_t to set the host allocator for. |
[in] | allocate_fn | function pointer to the allocate function to use for host allocations. |
[in] | deallocate_fn | function pointer to the deallocate function to use for host allocations. |
- Returns
- CUML_SUCCESS on success,
- Todo:
- : add more error codes