Subset of dense container

Subset of dense container

I have written function, I want to compute subset of dense container.
I just added a if condition.
But it spends a little more time than non-optimized "linear" version.
Is there any way to optimize\\parallelize this function?

void computemap(f32& result,f32 c1, f32 u1){
	usize i;

	_if ( i / x_shift >= 1 && i / x_shift  y_shift && (i % x_shift) = 1 && (i % x_shift) % y_shift & result, f32 c1, dense u1){

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

Hi, I have a few pieces of advice.

First, take a look at the many Knowledge Base articles we have for code tips.

Next, take a look at my article about Things to Consider.

It is understandable that your code would be slower than the serial version for the following reasons

-The _if is inlined and is not parallelized.
-There is overheadin yourfirst invocation of the ArBB function due to the JIT compile
- Even for runs2 through X, this ArBB function really isn't doing any majorcomputation to justify scaling across multiple cores.

I just asked one of my colleagues about specific code tips for your situation, and luckily we have an entire presentation you can look through for exact code snippets.Go to and starting with slide #22 it will address the subset of dense container.

Leave a Comment

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