fixed: tricorn.c, inverted the signs that were wrong
This commit is contained in:
@@ -45,8 +45,6 @@ void benchmarking(size_t benchmarking_amount, int version_to_use, float complex
|
||||
break;
|
||||
case 4: // Uses highly optimized SIMD
|
||||
printf("Benchmarking V4 - optimized SIMD implementation\n");
|
||||
tricorn_implementation = tricorn_V3;
|
||||
|
||||
tricorn_implementation = tricorn_V4;
|
||||
break;
|
||||
case 5: // Experimental cleanups and inlines / for testing
|
||||
|
||||
@@ -41,13 +41,13 @@ void tricorn(float complex start, size_t width, ssize_t height, float res, unsig
|
||||
|
||||
// Calculating the threadcount so that it is limited to a reasonable distribution where thread starting doesnt outway calculation cost
|
||||
size_t thread_count = get_thread_count();
|
||||
if(height >= min_rows_per_thread)
|
||||
while((height/thread_count) < min_rows_per_thread) thread_count--;
|
||||
if(abs_height >= min_rows_per_thread)
|
||||
while((abs_height/thread_count) < min_rows_per_thread) thread_count--;
|
||||
else thread_count = 1;
|
||||
|
||||
|
||||
|
||||
const size_t y_step = (height+thread_count-1)/thread_count;
|
||||
const size_t y_step = (abs_height+thread_count-1)/thread_count;
|
||||
const float start_r = crealf(start);
|
||||
const float start_i = cimagf(start);
|
||||
const float directional_res = (flipped ? -1.0f: 1.0f)*res;
|
||||
@@ -64,7 +64,7 @@ void tricorn(float complex start, size_t width, ssize_t height, float res, unsig
|
||||
for(size_t i = 0; i < thread_count; i++){
|
||||
compute_args* args = malloc(sizeof(*args));
|
||||
args->start_r =start_r;
|
||||
args->start_i =start_i-i*directional_res*y_step;
|
||||
args->start_i =start_i+i*directional_res*y_step;
|
||||
args->start_row = i*y_step;
|
||||
args->stop_row = abs_height < (args->start_row+y_step) ? abs_height: (args->start_row+y_step);
|
||||
args->consts = consts;
|
||||
@@ -176,8 +176,8 @@ static void* compute(void * vargs){
|
||||
c->img[position + 2] = ((value*5) % 255);
|
||||
}
|
||||
}
|
||||
c_imag -= vertical_step;
|
||||
c_imag_vector = _mm_sub_ps(c_imag_vector,vertical_step_vector);
|
||||
c_imag += vertical_step;
|
||||
c_imag_vector = _mm_add_ps(c_imag_vector,vertical_step_vector);
|
||||
}
|
||||
free(args);
|
||||
args = NULL;
|
||||
|
||||
Reference in New Issue
Block a user