Message Boards Message Boards

1
|
6209 Views
|
1 Reply
|
2 Total Likes
View groups...
Share
Share this post:

Need help optimizing a compiled function.

Posted 12 years ago
Currently, I have the following structure:
Function1 = Interpolation[Flatten[MATRIX, 1]];
I then call the function at some point as
Function1[x,y]
This all works well.

Later on, I do:
Function2 = Compile[
STUFF

Table = Table[Function1[Table, x2], {k, 1, Length[Table]}];
STUFF

RuntimeAttributes -> {Listable}, Parallelization -> True, CompilationTarget :> "C"];


Again, this works. However, I've narrowed down the time consuming step of my code to be here.
When I use:
On[Compile::noinfo];
I get:
Compile::noinfo: No information is available for compilation of Function1[Table,x2]. The compiler will use an external evaluation and make assumptions about the return type. >>

So, I guess the question, is there a way for me to incorporate the original function within the Compile I do for function2?


Thanks so much.
POSTED BY: Jordan Hoffmann
The problem is the Compile does not supportĀ Interpolation, so it will call the main evaluator. One way around that is to implement your own interpolator, but that requires a bit more code.
POSTED BY: Abdul Dakkak
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract