forked from openucx/ucc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* UTIL: mranged unsigned parameter * TL/UCP: range_uint for sra radix * BUILD: fix linter warns * TL/UCP: range_uint for kn_radix and cleanup * UTIL: fix additional auto case * REVIEW: code review fixes and gtest mrange parse Co-authored-by: Valentin Petrov <[email protected]>
- Loading branch information
1 parent
8ac022e
commit a7a641c
Showing
18 changed files
with
489 additions
and
74 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
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
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
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,46 @@ | ||
/** | ||
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
* See file LICENSE for terms. | ||
*/ | ||
|
||
#include "ucc_datastruct.h" | ||
#include "ucc_malloc.h" | ||
#include "ucc_compiler_def.h" | ||
#include "ucc_log.h" | ||
|
||
ucc_status_t ucc_mrange_uint_copy(ucc_mrange_uint_t *dst, | ||
const ucc_mrange_uint_t *src) | ||
{ | ||
ucc_mrange_t *r, *r_dup; | ||
|
||
dst->default_value = src->default_value; | ||
ucc_list_head_init(&dst->ranges); | ||
ucc_list_for_each(r, &src->ranges, list_elem) { | ||
r_dup = ucc_malloc(sizeof(*r_dup), "range_dup"); | ||
if (ucc_unlikely(!r_dup)) { | ||
ucc_error("failed to allocate %zd bytes for mrange", | ||
sizeof(*r_dup)); | ||
goto err; | ||
} | ||
r_dup->start = r->start; | ||
r_dup->end = r->end; | ||
r_dup->value = r->value; | ||
r_dup->mtypes = r->mtypes; | ||
ucc_list_add_tail(&dst->ranges, &r_dup->list_elem); | ||
} | ||
|
||
return UCC_OK; | ||
err: | ||
ucc_mrange_uint_destroy(dst); | ||
return UCC_ERR_NO_MEMORY; | ||
} | ||
|
||
void ucc_mrange_uint_destroy(ucc_mrange_uint_t *param) | ||
{ | ||
ucc_mrange_t *r, *r_tmp; | ||
|
||
ucc_list_for_each_safe(r, r_tmp, ¶m->ranges, list_elem) { | ||
ucc_list_del(&r->list_elem); | ||
ucc_free(r); | ||
} | ||
} |
Oops, something went wrong.