Open Source Your Knowledge, Become a Contributor
Technology knowledge has to be shared and made accessible for free. Join the movement.
Blocagem de loops
Multiplicação de matrizes
Por fim, temos a versão com blocagem, que explora melhor o uso das memórias cache. Experimente alterar o tamanho do bloco e compare os resultados, lembre-se que ele deve ser alterado no programa principal e também no kernel.
Multiplicação de matrizes - OpenCL
Open Source Your Knowledge: become a Contributor and help others learn. Create New Content
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//------------------------------------------------------------------------------
//
// Include fle for the Matrix Multiply test harness
//
// HISTORY: Written by Tim Mattson, August 2010
// Modified by Simon McIntosh-Smith, September 2011
// Modified by Tom Deakin and Simon McIntosh-Smith, October 2012
// Updated to C++ Wrapper v1.2.6 by Tom Deakin, August 2013
//
//------------------------------------------------------------------------------
#ifndef __MULT_HDR
#define __MULT_HDR
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <vector>
#define __CL_ENABLE_EXCEPTIONS
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include "cl.hpp"
#include "util.hpp"
#include "matrix_lib.hpp"
Enter to Rename, Shift+Enter to Preview
1
//------------------------------------------------------------------------------
Enter to Rename, Shift+Enter to Preview
1
//-------------------------------------------------------------
Enter to Rename, Shift+Enter to Preview