int main(int argc, char **argv) { test_icd_initialize_app_log(); test_icd_initialize_stub_log(); test_create_calls(); test_platforms(); test_cl_runtime(); test_kernel(); test_buffer_object(); test_program_objects(); test_image_objects(); test_sampler_objects(); test_OpenGL_share(); // test_Direct3D10_share(); test_release_calls(); test_icd_close_app_log(); test_icd_close_stub_log(); if (test_icd_match()) { printf("ICD Loader Test FAILED\n"); return 1; } else { printf("ICD Loader Test PASSED\n"); return 0; } }
int main() { test_kernel(KernelSkeleton()); // KernelSkeleton test_kernel(UnitPotential()); // UnitKernel test_kernel(ExpPotential()); // ExpKernel test_kernel(LaplacePotential()); // Laplace test_kernel(LaplaceKernel()); // Laplace test_kernel(YukawaPotential(1.0)); // Yukawa test_kernel(YukawaKernel(1.0)); // Yukawa test_kernel(HelmholtzPotential(1.0)); // Helmholtz test_kernel(HelmholtzKernel(1.0)); // Helmholtz test_kernel(Stokeslet()); // Stokes }
int main(void) { int A[BUFFER_SIZE]; int R[WORK_ITEMS]; int a = 2; for (int i = 0; i < BUFFER_SIZE; i++) { A[i] = i; } for (int i = 0; i < WORK_ITEMS; i++) { R[i] = i; } test_kernel(A, R); for (int i = 0; i < WORK_ITEMS; ++i) { printf("res %d = %d\n", i, R[i]); } }
/* ------------------------------------------ */ int test_filterNR(int argc, const char * argv[]) /* ------------------------------------------ */ { puts("====================="); puts("=== test_filterNR ==="); puts("====================="); generate_sample(); // guess test_gaussian_noise(); // fonctions de bruitage des images test_impulse_noise(); // tests unitaires test_kernel(); test_otsu(); test_histogram_equalization(); // fonctions de debruitage des images test_smooth_filter(); test_median_filter(); return 0; }
int main(int argc, char *argv[]) { test_kernel(); return 0; }
// host stub function void ops_par_loop_test_kernel(char const *name, ops_block block, int dim, int *range, ops_arg arg0, ops_arg arg1) { // Timing double t1, t2, c1, c2; char *p_a[2]; int offs[2][1]; ops_arg args[2] = {arg0, arg1}; #ifdef CHECKPOINTING if (!ops_checkpointing_before(args, 2, range, 14)) return; #endif if (OPS_diags > 1) { ops_timing_realloc(14, "test_kernel"); OPS_kernels[14].count++; ops_timers_core(&c2, &t2); } // compute locally allocated range for the sub-block int start[1]; int end[1]; #ifdef OPS_MPI sub_block_list sb = OPS_sub_block_list[block->index]; #endif #ifdef OPS_DEBUG ops_register_args(args, "test_kernel"); #endif int arg_idx[1]; int arg_idx_base[1]; #ifdef OPS_MPI if (compute_ranges(args, 2, block, range, start, end, arg_idx) < 0) return; #else // OPS_MPI for (int n = 0; n < 1; n++) { start[n] = range[2 * n]; end[n] = range[2 * n + 1]; arg_idx[n] = start[n]; } #endif // OPS_MPI for (int n = 0; n < 1; n++) { arg_idx_base[n] = arg_idx[n]; } offs[0][0] = args[0].stencil->stride[0] * 1; // unit step in x dimension int off0_0 = offs[0][0]; int dat0 = (OPS_soa ? args[0].dat->type_size : args[0].dat->elem_size); // set up initial pointers and exchange halos if necessary int base0 = args[0].dat->base_offset + (OPS_soa ? args[0].dat->type_size : args[0].dat->elem_size) * start[0] * args[0].stencil->stride[0]; p_a[0] = (char *)args[0].data + base0; #ifdef OPS_MPI p_a[1] = ((ops_reduction)args[1].data)->data + ((ops_reduction)args[1].data)->size * block->index; #else p_a[1] = ((ops_reduction)args[1].data)->data; #endif // initialize global variable with the dimension of dats xdim0 = args[0].dat->size[0]; // Halo Exchanges ops_H_D_exchanges_host(args, 2); ops_halo_exchanges(args, 2, range); ops_H_D_exchanges_host(args, 2); if (OPS_diags > 1) { ops_timers_core(&c1, &t1); OPS_kernels[14].mpi_time += t1 - t2; } int n_x; #pragma novector for (n_x = start[0]; n_x < start[0] + ((end[0] - start[0]) / SIMD_VEC) * SIMD_VEC; n_x += SIMD_VEC) { // call kernel function, passing in pointers to data -vectorised for (int i = 0; i < SIMD_VEC; i++) { test_kernel((double *)p_a[0] + i * 1 * 1, (double *)p_a[1]); } // shift pointers to data x direction p_a[0] = p_a[0] + (dat0 * off0_0) * SIMD_VEC; } for (int n_x = start[0] + ((end[0] - start[0]) / SIMD_VEC) * SIMD_VEC; n_x < end[0]; n_x++) { // call kernel function, passing in pointers to data - remainder test_kernel((double *)p_a[0], (double *)p_a[1]); // shift pointers to data x direction p_a[0] = p_a[0] + (dat0 * off0_0); } if (OPS_diags > 1) { ops_timers_core(&c2, &t2); OPS_kernels[14].time += t2 - t1; } ops_set_dirtybit_host(args, 2); if (OPS_diags > 1) { // Update kernel record ops_timers_core(&c1, &t1); OPS_kernels[14].mpi_time += t1 - t2; OPS_kernels[14].transfer += ops_compute_transfer(dim, start, end, &arg0); } }