-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
I am not understanding how one provides a user-defined opDef to an nFunction (and more generally to an nClass).
I think I mostly get how one provides a global user-defined opDef.
However, I thought one should be able to do something like this.
nimArray2_opDef <- nCompiler:::getOperatorDef("nimArray") # presume `nimArray` operator is set up as in `test-userOps.R`.
foo = nFunction(
function() {
ans <- nimArray2( 6, dim = 2)
return(ans)
returnType('double(1)')
},
compileInfo = list(opDef = list(nimArray2 = nimArray2_opDef))
)
cfoo <- nCompile(foo)
An error occurred in compiler stage normalizeCalls:
No operator definition found for nimArray2.
where nimArray2 is my new operator and I want to say how it is handled by providing the opDef as part of compileInfo.
Note that I would think the opDef value provided should be a named list, so that the opDef info for nArray2 can be found. But that is not what is done in the examples in the "nFunction custom opDef works through a sequence of changes and handlers" test in test-userOps.R, so clearly I am not understanding something here.
This could be a placeholder for a direct discussion with @perrydv .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels