|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Out of Memory while compiling script defining 3630 element array
#432889
11/18/13 16:25
11/18/13 16:25
|
Joined: Sep 2013
Posts: 504 California
GPEngine
OP
User
|
OP
User
Joined: Sep 2013
Posts: 504
California
|
My script requires about 15 constant matrices of floats to perform a few transformations on a handful of input indicators. (If you're curious, the transformation is PCA projection.) To accomplish this I have tried to initialize the arrays in the code, like this:
static var pc_1[121][30] = {
-0.157275083866484, 0.151902882281035, -0.00459335364287939,
0.0130055542759733, -0.00446267164469449, 0.00249909658366857,
-0.0466348517770217, 0.0136211757432005, -0.0478944036910219,
...
}
I find I get a compile-time error, Out Of Memory, when the matrices I'm trying to define are 121x30. If I change the program to get by with 15 121x20 matrices instead, the compile step is successful, and the program is correct in operation. So I conclude that the lite-C compiler chokes on initialization of a large array using literals expressed in the code, or that there is a low upper limit on the size of the output binary. Do you have any strategies for getting around this limitation? I was thinking of reading the values of pc_1 from a text file using file_read at runtime instead. But it will take me some effort to get that right considering the string to float conversion. Before I embark on that, I thought I'd ask, do you think it will work? My back up plan, which I'm not at all happy with, is to run a background process that is capable of handling this calculation (R perhaps) and have Zorro consult with it (via RPC maybe, somehow) at every bar. Boo.
Last edited by GPEngine; 11/18/13 16:28.
|
|
|
Re: Out of Memory while compiling script defining 3630 element array
[Re: jcl]
#432891
11/18/13 19:03
11/18/13 19:03
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
@jcl, maybe you could setup a higher limit for the compiler? In case you want to share those big matrices, it seems to be more comfortable to have them in the sourcefile.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
|