About GPU program of matrix inversion parallel [closed]

asked 2012-11-26 07:09:19 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

I have a this function for inverse of matix in main.cpp...

template int test_map (int N, T *A)
{
    // 1. compute reference solution
    synmod_map_seq (N, A);

    // 2. compute solution with parallel module
    T *dA;
    GPU_alloc_dev_ptr (N*N, &dA);
    GPU_copy_data_to_device (N*N, A, dA);
    synmod_map_gpu (N, dA);
    GPU_copy_data_from_device (N*N, dA, A);
    GPU_free_dev_ptr (&dA);
}

In synmod_map_seq.cpp file i write like this:

template static int synmod_map_seq_internal (int N, T *A)
{
    for (int i = 0; i < N; i++)
        A[i] = -A[i];

    return 0;
}
int synmod_map_seq (int N, int *A)
{
    return synmod_map_seq_internal (N, A);
}
int synmod_map_seq (int N, float *A)
{
    return synmod_map_seq_internal (N, A);
}
int synmod_map_seq (int N, double *A)
{
    return synmod_map_seq_internal (N, A);
}

in synmod_map_gpu.cu file i call synmod_map_gpu function from main.cpp now problem is that i dont understand what to write for function "synmod_map_gpu"

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by Vladislav Vinogradov
close date 2012-11-26 09:55:45.910202

Comments

Your question is not related to OpenCV or CV.

Vladislav Vinogradov gravatar imageVladislav Vinogradov ( 2012-11-26 09:55:10 -0500 )edit