int main_conv(int argc, char* argv[]) { cmdline(&argc, argv, 4, 4, usage_str, help_str, 0, NULL); num_init(); unsigned int flags = atoi(argv[1]); unsigned int N = DIMS; long dims[N]; const complex float* in = load_cfl(argv[2], N, dims); long krn_dims[N]; const complex float* krn = load_cfl(argv[3], N, krn_dims); complex float* out = create_cfl(argv[4], N, dims); struct conv_plan* plan = conv_plan(N, flags, CONV_CYCLIC, CONV_SYMMETRIC, dims, dims, krn_dims, krn); conv_exec(plan, out, in); conv_free(plan); unmap_cfl(N, dims, out); unmap_cfl(N, krn_dims, krn); unmap_cfl(N, dims, in); exit(0); }
void overlapandsave_exec(struct conv_plan* plan, int N, const long dims[N], const long blk[N], complex float* dst, complex float* src1, const long dim2[N]) { md_clear(2 * N, L, tmp, 8); md_copy2(2 * N, ndim3, str2, tmp, str1, src1, 8); conv_exec(plan, dst, tmp); free(tmp); }
int main_conv(int argc, char* argv[]) { int c; while (-1 != (c = getopt(argc, argv, "ah"))) { switch (c) { case 'h': usage(argv[0], stdout); help(); exit(0); default: usage(argv[0], stderr); exit(1); } } if (argc - optind != 4) { usage(argv[0], stderr); exit(1); } unsigned int flags = atoi(argv[optind + 0]); unsigned int N = DIMS; long dims[N]; const complex float* in = load_cfl(argv[optind + 1], N, dims); long krn_dims[N]; const complex float* krn = load_cfl(argv[optind + 2], N, krn_dims); complex float* out = create_cfl(argv[optind + 3], N, dims); struct conv_plan* plan = conv_plan(N, flags, CONV_CYCLIC, CONV_SYMMETRIC, dims, dims, krn_dims, krn); conv_exec(plan, out, in); conv_free(plan); unmap_cfl(N, dims, out); unmap_cfl(N, krn_dims, krn); unmap_cfl(N, dims, in); exit(0); }
static void linop_conv_forward(const linop_data_t* _data, complex float* out, const complex float* in) { struct conv_data_s* data = CAST_DOWN(conv_data_s, _data); conv_exec(data->plan, out, in); }