-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BINDINGS/GO/PERF: Implement flag.Value for UcsMemoryType - 2
- Loading branch information
1 parent
381317d
commit e7281f4
Showing
3 changed files
with
37 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2024, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. | ||
* See file LICENSE for terms. | ||
*/ | ||
#ifndef GO_UCS_CONSTANTS_H_ | ||
#define GO_UCS_CONSTANTS_H_ | ||
|
||
#include <ucs/memory/memory_type.h> | ||
#include <ucs/sys/string.h> | ||
#include <stdlib.h> | ||
|
||
static inline const char* ucxgo_get_ucs_mem_type_name(ucs_memory_type_t idx) { | ||
return ucs_memory_type_names[idx]; | ||
} | ||
|
||
static inline ssize_t ucxgo_parse_ucs_mem_type_name(void* value) { | ||
ssize_t idx = ucs_string_find_in_list((const char *)value, ucs_memory_type_names, 0); | ||
free(value); | ||
return idx; | ||
} | ||
|
||
#endif |