Forums > Dev

Parallelizing spatial matrix operations

February 8, 2010 | 11:42 am

I’m working on parallelizing a jitter mop algorithm that needs to know the row (y-axis).

From MaxAPI-5.1.1: "[i]f your object performs some kind of spatial operation… you will … need to account for the matrix segmentation used by the parallel utilities"

I thought to store the base pointer in my object and then do something like the following in calculate_ndim:

int start_row = (bop – x->bop) / minfo->dimstride[1];

My question is: is pointer arithmetic a kosher approach? Can I rely on the memory being contiguous, etc.

Cheers,
Chris


February 11, 2010 | 8:52 pm

Bump.

Maybe the question was unclear?


February 12, 2010 | 6:55 am

Yes, that is actually a clever way to accomplish this.

It’s not documented in the SDK, but we pass on the stack the t_jit_parallel_ndim_worker struct after all the traditional arguments to your calculate_ndim function. You can grab the row from t_jit_parallel_ndim_worker.offset[1].

Let us know if you have issues.

-Joshua


Viewing 3 posts - 1 through 3 (of 3 total)