Skip to content

Commit

Permalink
Add ability to work with OIF_INT output parameters in Python implemen…
Browse files Browse the repository at this point in the history
…tations
  • Loading branch information
dmitry-kabanov committed Sep 12, 2024
1 parent 7cabeb1 commit 5e641a4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion oif_impl/lang_python/dispatch_python.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,9 @@ call_impl(ImplInfo *impl_info, const char *method, OIFArgs *in_args, OIFArgs *ou
// Convert output arguments.
for (size_t i = 0; i < out_args->num_args; ++i) {
if (out_args->arg_types[i] == OIF_INT) {
pValue = PyLong_FromLong(*(int *)out_args->arg_values[i]);
int *tmp = *(int **)out_args->arg_values[i];
printf("tmp ===== %d\n", *tmp);
pValue = PyArray_SimpleNewFromData(1, (intptr_t[1]){1}, NPY_INT32, tmp);
}
else if (out_args->arg_types[i] == OIF_FLOAT64) {
pValue = PyFloat_FromDouble(*(double *)out_args->arg_values[i]);
Expand Down

0 comments on commit 5e641a4

Please sign in to comment.