-
Notifications
You must be signed in to change notification settings - Fork 434
[STF] Add python bindings #5315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 250 commits
1457893
cf7753f
1f80e6a
1e29a51
fb5dddf
76c7bae
9e95107
8fe3c16
c9cee96
224eba1
3cbbdd5
f3ef1cd
34e7139
21ae4ec
e19673d
be2552b
3c77d25
0dc2d03
cbbcc2f
cb05626
49ddbe9
cab9f71
64d5848
486ca13
6ed1987
bb67603
7f72b99
dab73bd
11b8b8b
c0fd7d7
d547abc
3993bf4
689c531
93ecafd
17a2bf7
faf493b
c283065
829268f
6e857a9
2ae0272
7c5b72f
32ddf6d
d484e62
817bb50
947d0d2
f8b7fdd
5691af8
5f97c52
1e7c033
b3e6867
81ca39a
4492a10
e6965a9
4f2fb3c
04ec9ad
160396c
66aba5b
c71b509
98e3af5
c1f3eed
55f34c9
fae0627
9a54c5a
ee49ef6
0b5262d
cd232da
b5939a5
243062a
4459823
87ce7c8
438acb7
4e91f5d
12b4129
551d760
08ce080
2d00b94
2b6d021
cec4ac4
209e1f6
c4de5c5
ce80f97
327bc18
4e1d024
35c405d
e3c3316
ded36ad
545179b
14d7f81
f241555
364fee9
3fd17d3
0e014b7
ad7bb2e
b470925
294b486
8ea81e9
efbcad3
edb3c43
e42c596
efc47ce
89dc425
01f0bf4
10568d5
4fa8dc7
f353320
29ba25d
d96ced9
eb87418
d08b214
035a30a
6110331
49df167
a07cae1
bbddedc
dbee3d8
e65d392
849f388
a1575f5
6928491
eea8693
572eff3
6207eb7
1aee7be
10b4fb2
c238595
56818a9
908f59b
ca3c399
c71fa7e
13d88ee
75b2a8c
836a023
cd0f0c0
6f0ecf9
eabf767
2a15440
9af49af
3342fd1
a89c8b1
07d55cf
8d6cc27
685ab5b
82d20ce
c893ca9
37c960c
8c05e60
f18ac6c
40540d5
677c381
20f730b
384102b
5f3e210
59d8620
4b066f7
bd825ea
076fe32
e32d9f3
3fa91d2
50188fb
82194f3
687aefb
16ebcd5
2da1c87
d74bdd9
659a8e3
980a2e8
34188f6
44f8384
308ccc7
f6bba0c
b06e62d
4600142
ade7c92
e892da6
05d90f0
4f93f06
b48b384
7a729d6
1a08dde
bf1d107
e4d533d
0f40e7a
a4917ad
8cdae5e
f568c81
f2670d6
21d2ea7
5724d1a
11f2e8a
4c3c49d
9529906
5eddfed
de030ef
649efcf
e8aa706
6402287
6191f45
bf3f3cd
ee08ce0
2bf929e
60f9329
cd181aa
9a015d4
3f46ed3
3862573
a0bfbf7
f0f5504
79f8817
be563bf
b19c931
9a78a9f
82c264f
8ceb5bb
77b1239
9ee10c4
f136e94
c5add2b
5e2f4d5
8eca120
d10c312
dd39a9b
a773057
13ef970
f101d43
accc384
407e646
b9b1254
be61301
1b291c4
126896b
f32ff62
0bbdd60
1a7d3a4
2f41158
4610a32
e739557
61e7d3f
93918dc
cbceed3
b8ea935
23d1b57
9ef5687
64db026
3e8b3fa
a4032b0
8dc1432
4e3d6f4
60cd8e5
de7befe
c0b8626
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
caugonnet marked this conversation as resolved.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved to #9705 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2050,6 +2050,51 @@ void stf_stackable_while_cond_scalar( | |
| double threshold, | ||
| stf_dtype dtype); | ||
|
|
||
| //! \brief Maximum number of terms accepted by \c stf_stackable_while_cond_multi(). | ||
| # define STF_WHILE_COND_MAX_TERMS 8 | ||
|
|
||
| //! \brief Combiner for multi-term while conditions. | ||
| typedef enum stf_cond_combiner | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could be extracted as as standalone PR (C combined conditions)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extracted in #10006 |
||
| { | ||
| STF_COND_ALL = 0, //!< Continue while every term holds (logical AND) | ||
| STF_COND_ANY = 1, //!< Continue while at least one term holds (logical OR) | ||
| } stf_cond_combiner; | ||
|
|
||
| //! \brief One comparison term of a multi-term while condition. | ||
| //! | ||
| //! Evaluates as ``(*ld <op> threshold)``, then negated if \c negate is nonzero. | ||
| typedef struct stf_while_cond_term | ||
| { | ||
| stf_logical_data_handle ld; //!< Scalar logical data (1 element of \c dtype) | ||
| stf_compare_op op; //!< Comparison operator | ||
| double threshold; //!< Right-hand side compared against the scalar | ||
| stf_dtype dtype; //!< Element type of \c ld | ||
| int negate; //!< Nonzero to negate the term result | ||
| } stf_while_cond_term; | ||
|
|
||
| //! \brief Set a compound while-loop condition combining several scalar comparisons. | ||
| //! | ||
| //! Schedules a single internal task that reads every referenced scalar | ||
| //! logical data, evaluates each ``(*ld <op> threshold)`` term (with optional | ||
| //! negation) and folds the results with the requested combiner: continue | ||
| //! while *all* terms hold (\c STF_COND_ALL) or while *any* term holds | ||
| //! (\c STF_COND_ANY). Call exactly once per iteration after the loop body | ||
| //! tasks of the current scope. | ||
| //! | ||
| //! With \p n_terms == 1 this is equivalent to \c stf_stackable_while_cond_scalar(). | ||
| //! | ||
| //! \param ctx Stackable context handle | ||
| //! \param scope While scope handle | ||
| //! \param terms Array of \p n_terms comparison terms | ||
| //! \param n_terms Number of terms (1 to \c STF_WHILE_COND_MAX_TERMS) | ||
| //! \param combiner How the term results are combined | ||
| void stf_stackable_while_cond_multi( | ||
| stf_ctx_handle ctx, | ||
| stf_while_scope_handle scope, | ||
| const stf_while_cond_term* terms, | ||
| int n_terms, | ||
| stf_cond_combiner combiner); | ||
|
|
||
| #endif // CUDART_VERSION >= 12040 | ||
|
|
||
| //! \brief Create stackable logical data from existing memory and a data place. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of #9782