3.3.2.1.1 : Le fichier hadamard_product_cuda.h
Développons le fichier hadamard_product_cuda.h :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef __HADAMARD_PRODUCT_CUDA_H__
#define __HADAMARD_PRODUCT_CUDA_H__

#include <cuda.h>
#include <cuda_runtime.h>

#include "phoenix_cuda_check.h"

void hadamard_product_cuda(float * vecResult, const float * vectLeft, const float * vectRight, int nbElement,
			   int maxNbThreadPerBlockX, int maxNbBlockX, int warpSize);
void hadamard_product_cuda_clock(float * vecResult, const float * vectLeft, const float * vectRight, int nbElement, int nbRepeat,
						int maxNbThreadPerBlockX, int maxNbBlockX, int warpSize);


#endif


Le fichier hadamard_product_cuda.h complet.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/***************************************
	Auteur : Pierre Aubert
	Mail : pierre.aubert@lapp.in2p3.fr
	Licence : CeCILL-C
****************************************/

#ifndef __HADAMARD_PRODUCT_CUDA_H__
#define __HADAMARD_PRODUCT_CUDA_H__

#include <cuda.h>
#include <cuda_runtime.h>

#include "phoenix_cuda_check.h"

void hadamard_product_cuda(float * vecResult, const float * vectLeft, const float * vectRight, int nbElement,
			   int maxNbThreadPerBlockX, int maxNbBlockX, int warpSize);
void hadamard_product_cuda_clock(float * vecResult, const float * vectLeft, const float * vectRight, int nbElement, int nbRepeat,
						int maxNbThreadPerBlockX, int maxNbBlockX, int warpSize);


#endif


Vous pouvez télécharger le fichier ici.