Simple array difference problem

Simple array difference problem

Hi,

I`m developing some examples with ArBB. One of these examples is a
simple array difference. I'm using sizes like 2000x2000, 8000x8000 but
when I try execute the code with 16384*16384 the aplicattion crashes.
However, I can execute the code for 14500*14500 for example.

My code allocates three vectors:

intsize = width * height;

unsigned char*frame = static_cast
char*>(arbb::aligned_malloc(sizeof(unsigned char)*size));

unsigned char* background = static_cast
char*>(arbb::aligned_malloc(sizeof(unsigned char)*size));

unsigned char* resultArbb = static_cast
char*>(arbb::aligned_malloc(size * sizeof(unsigned char)));

And then initialized it. The next step is to call to ArBB routine and to
bind the vectors.

dense vec_frame; bind(vec_frame, frame, width*height);

dense vec_background; bind(vec_background, background, width*height);

dense vec_result; bind(vec_result, result, width*height);

The error happens in the first binding. The ArBB error is:

"Internal error: CTE_COMPILER_ERROR COMP_ERROR: Dynamic Compiler

Internal Error "

My first impression is something related to the memory heap
size, but I have tried the function arbb_set_heap_size with a heap's
size of 1GB and the problem doesn't dissapear. Is there any limitation of vector's size?

Thank you!

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Which version of ArBB are you using? This cannot be reproduced using ArBB Beta 5 (the latest release). Please try it with Beta 5 and let us know. Here's the complete code that I attempted to reproduce your problem. It worked fine even with ARBB_MAX_HEAP being 512M.

#include
#include

#define WIDTH 16384
#define HEIGHT 16384

using namespace arbb;

typedef arbb::u8 T;

void diff(dense a, dense b, dense& out)
{
out = a - b;
}

int main()
{
try {
int size = WIDTH * HEIGHT;

unsigned char*frame = static_cast(
aligned_malloc(sizeof(unsigned char)*size));

unsigned char* background = static_cast(
aligned_malloc(sizeof(unsigned char)*size));

unsigned char* resultArbb = static_cast(
aligned_malloc(size * sizeof(unsigned char)));

dense vec_frame; bind(vec_frame, frame, WIDTH*HEIGHT);

dense vec_background; bind(vec_background, background, WIDTH*HEIGHT);

dense vec_result; bind(vec_result, resultArbb, WIDTH*HEIGHT);

call(diff)(vec_frame, vec_background, vec_result);

const_range r = vec_result.read_only_range();

} catch (const std::exception& e) {
std::cerr << "Exception caught: " << e.what() << std::endl;
return 1;
} catch (...) {
std::cerr << "Unknown exception" << std::endl;
return 1;
}

return 0;
}

I use ArBB Beta 5 32bits.

I tried your code on my pc (Core i7, 8GB RAM, Vista 64) and it crashed although in another computer (Core 2 Duo, Win7, 32bits) it worked nicely.

Can the platform be the problem?

Thanks for your answer!!

David,

Do you have multiple versions of ArBB, for example, beta 4 and beta 5, installed on the Core 2 Duo system? If so then you probably need to completely uninstall all versions before re-install beta 5. This is a problem that some other users have reported. I'm not sure whehter it is the reason in your case, but give it a try please.

Thanks.

Leave a Comment

Please sign in to add a comment. Not a member? Join today