Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

different kernels for different architectures

Tags:

cuda

I am wondering if there is some easy way as to have different versions of a kernel for different architectures. Is their an easy way? or the only possibility is to define independent kernels in independent files and ask nvcc to compile to different architecture per file?

like image 849
Daniel Avatar asked Feb 18 '14 20:02

Daniel


People also ask

What are the different kernel architectures?

This includes four main architectures namely monolithic, microkernel, exokernel and hybrid kernel.

What are the 5 types of kernel?

Kernels are of five types, namely monolithic, microkernel, nanokernel, hybrid kernel and exokernel. Functions of a kernel include scheduling processes, resource allocation, device management, interrupt handling, memory management, and process management.

What are the different kernel?

It has five types, namely, monolithic kernel, microkernel, hybrid kernel, nano kernel, and exo kernel. The functions of a kernel include accessing computer resources, memory management, device management, and resource management.

What are 2 major types of kernel?

A Kernel is classified into two main types: Monolithic Kernel. Micro Kernel.


1 Answers

You can do that by compiler directives. Something like

__global__ void kernel(...) {

# if __CUDA_ARCH__ >= 350

    do something

# else

    do something else

# endif

}    
like image 155
Vitality Avatar answered Oct 11 '22 06:10

Vitality