magma_dscal_dger_native

7 views
Skip to first unread message

aran nokan

unread,
May 6, 2021, 1:30:58 PMMay 6
to MAGMA User
Hi,

I am reading the code of magma_dscal_dger_native but I am confused why you are calling kernel like that:

dscal_dger_1d_kernel_native<N><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);

    switch(n){
        case 1:dscal_dger_1d_kernel_native<1><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 2:dscal_dger_1d_kernel_native<2><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 3:dscal_dger_1d_kernel_native<3><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 4:dscal_dger_1d_kernel_native<4><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 5:dscal_dger_1d_kernel_native<5><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 6:dscal_dger_1d_kernel_native<6><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 7:dscal_dger_1d_kernel_native<7><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        case 8:dscal_dger_1d_kernel_native<8><<<grid, threads, 0, queue->cuda_stream()>>>( m, step, dA, lda, info, gbstep);break;
        default:dscal_dger_1d_generic_kernel_native<<<grid, threads, 0, queue->cuda_stream()>>>( m, n, step, dA, lda, info, gbstep);
    }


https://paste.ubuntu.com/p/h5MW3F6gzn/

What is the idea behind this?

Best regards,

Aran

Ahmad Abdelfattah

unread,
May 6, 2021, 1:34:12 PMMay 6
to aran nokan, MAGMA User
This is a kernel that is written using C++ templates. You have to explicitly instantiate the kernel at compile-time. The template parameter ’N’ is used to allocate a register buffer. If ’N’ is not a compile-time constant, you should get a compilation error.

Ahmad


--
You received this message because you are subscribed to the Google Groups "MAGMA User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magma-user+...@icl.utk.edu.
To view this discussion on the web visit https://groups.google.com/a/icl.utk.edu/d/msgid/magma-user/CAKHt_YbktGbNWzO3ZozH17D5JrEH3nAhAf7h37do-vmrD-q6Vw%40mail.gmail.com.

aran nokan

unread,
May 6, 2021, 4:09:45 PMMay 6
to Ahmad Abdelfattah, MAGMA User
Thank you for the clarification. Why are you using a multi small kernel instead of a big kernel? As I understand it for factorization of a column we will have multiple small kernels.

Ahmad Abdelfattah

unread,
May 6, 2021, 7:24:42 PMMay 6
to aran nokan, MAGMA User
I am not sure what you mean by “small” and “big” kernels. This kernel combines the column scaling followed by the rank-1 update. The parameter ’N’ represents the width of the panel, not the length of the column, so even the kernel instance of (N = 1) can operate on very tall panels. 

Ahmad
Reply all
Reply to author
Forward
0 new messages