Enviar pesquisa
Carregar
Multiplicação de matrizes em cuda
•
Transferir como PPTX, PDF
•
1 gostou
•
3,705 visualizações
John Tortugo
Seguir
Exemplos de Multiplicação de Matrizes em CUDA.
Leia menos
Leia mais
Educação
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 30
Baixar agora
Recomendados
Templates in c++
Templates in c++
Mayank Bhatt
Implementation of c string functions
Implementation of c string functions
mohamed sikander
An introduction to Python for absolute beginners
An introduction to Python for absolute beginners
Kálmán "KAMI" Szalai
Python Programming
Python Programming
Sreedhar Chowdam
張逸 - 研究所 / 轉學考計算機概論 、公職計算機概要 - 基本計概 - 試閱版
張逸 - 研究所 / 轉學考計算機概論 、公職計算機概要 - 基本計概 - 試閱版
逸 張
Python_ 3 CheatSheet
Python_ 3 CheatSheet
Dr. Volkan OBAN
C++11 & C++14
C++11 & C++14
CyberPlusIndia
Control statements
Control statements
raksharao
Recomendados
Templates in c++
Templates in c++
Mayank Bhatt
Implementation of c string functions
Implementation of c string functions
mohamed sikander
An introduction to Python for absolute beginners
An introduction to Python for absolute beginners
Kálmán "KAMI" Szalai
Python Programming
Python Programming
Sreedhar Chowdam
張逸 - 研究所 / 轉學考計算機概論 、公職計算機概要 - 基本計概 - 試閱版
張逸 - 研究所 / 轉學考計算機概論 、公職計算機概要 - 基本計概 - 試閱版
逸 張
Python_ 3 CheatSheet
Python_ 3 CheatSheet
Dr. Volkan OBAN
C++11 & C++14
C++11 & C++14
CyberPlusIndia
Control statements
Control statements
raksharao
Structure in c#
Structure in c#
Dr.Neeraj Kumar Pandey
Introduction to python
Introduction to python
Yi-Fan Chu
Network programming Using Python
Network programming Using Python
Karim Sonbol
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
Sumant Tambe
Pointer in C
Pointer in C
Sonya Akter Rupa
Niger National Flag
Niger National Flag
SH Rajøn
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
Kasun Ranga Wijeweera
Graphical representation of Stack
Graphical representation of Stack
Sanjay Kumar Chakravarti
Function in C
Function in C
Dr. Abhineet Anand
3 data-types-in-c
3 data-types-in-c
teach4uin
Structure in c
Structure in c
baabtra.com - No. 1 supplier of quality freshers
深入淺出C語言
深入淺出C語言
Simen Li
Basics of Model/View Qt programming
Basics of Model/View Qt programming
ICS
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
Ankur Pandey
Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
Salahaddin University-Erbil
Structure and Typedef
Structure and Typedef
Acad
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the ugly
Dror Helper
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
Yung-Yu Chen
Array
Array
PRN USM
An introduction to Rust: the modern programming language to develop safe and ...
An introduction to Rust: the modern programming language to develop safe and ...
Claudio Capobianco
Aula 09 08-2013
Aula 09 08-2013
Ludmylla Lima Figueiredo
Multiplicação de matrizes
Multiplicação de matrizes
Diego Lusa
Mais conteúdo relacionado
Mais procurados
Structure in c#
Structure in c#
Dr.Neeraj Kumar Pandey
Introduction to python
Introduction to python
Yi-Fan Chu
Network programming Using Python
Network programming Using Python
Karim Sonbol
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
Sumant Tambe
Pointer in C
Pointer in C
Sonya Akter Rupa
Niger National Flag
Niger National Flag
SH Rajøn
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
Kasun Ranga Wijeweera
Graphical representation of Stack
Graphical representation of Stack
Sanjay Kumar Chakravarti
Function in C
Function in C
Dr. Abhineet Anand
3 data-types-in-c
3 data-types-in-c
teach4uin
Structure in c
Structure in c
baabtra.com - No. 1 supplier of quality freshers
深入淺出C語言
深入淺出C語言
Simen Li
Basics of Model/View Qt programming
Basics of Model/View Qt programming
ICS
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
Ankur Pandey
Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
Salahaddin University-Erbil
Structure and Typedef
Structure and Typedef
Acad
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the ugly
Dror Helper
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
Yung-Yu Chen
Array
Array
PRN USM
An introduction to Rust: the modern programming language to develop safe and ...
An introduction to Rust: the modern programming language to develop safe and ...
Claudio Capobianco
Mais procurados
(20)
Structure in c#
Structure in c#
Introduction to python
Introduction to python
Network programming Using Python
Network programming Using Python
Fun with Lambdas: C++14 Style (part 1)
Fun with Lambdas: C++14 Style (part 1)
Pointer in C
Pointer in C
Niger National Flag
Niger National Flag
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
Graphical representation of Stack
Graphical representation of Stack
Function in C
Function in C
3 data-types-in-c
3 data-types-in-c
Structure in c
Structure in c
深入淺出C語言
深入淺出C語言
Basics of Model/View Qt programming
Basics of Model/View Qt programming
Keywords, identifiers ,datatypes in C++
Keywords, identifiers ,datatypes in C++
Object-Oriented Programming Using C++
Object-Oriented Programming Using C++
Structure and Typedef
Structure and Typedef
C++ Unit testing - the good, the bad & the ugly
C++ Unit testing - the good, the bad & the ugly
Notes about moving from python to c++ py contw 2020
Notes about moving from python to c++ py contw 2020
Array
Array
An introduction to Rust: the modern programming language to develop safe and ...
An introduction to Rust: the modern programming language to develop safe and ...
Destaque
Aula 09 08-2013
Aula 09 08-2013
Ludmylla Lima Figueiredo
Multiplicação de matrizes
Multiplicação de matrizes
Diego Lusa
II EPI - Estudo e Avaliação do Problema de Otimização da Multiplicação de Cad...
II EPI - Estudo e Avaliação do Problema de Otimização da Multiplicação de Cad...
Eduardo de Lucena Falcão
Multiplicação de Matrizes
Multiplicação de Matrizes
Diego Lusa
Multiplicacao de matrizes
Multiplicacao de matrizes
Glauber Cruz
Matriz curric. matematica e.médio 2010
Matriz curric. matematica e.médio 2010
Creison
Plano de aula: Aspectos Didático-pedagógicos da Matemática no Ensino Médio II
Plano de aula: Aspectos Didático-pedagógicos da Matemática no Ensino Médio II
Elton Ribeiro da Cruz
Planejamento Matrizes e determinantes
Planejamento Matrizes e determinantes
MarcieleEuzebio
Destaque
(8)
Aula 09 08-2013
Aula 09 08-2013
Multiplicação de matrizes
Multiplicação de matrizes
II EPI - Estudo e Avaliação do Problema de Otimização da Multiplicação de Cad...
II EPI - Estudo e Avaliação do Problema de Otimização da Multiplicação de Cad...
Multiplicação de Matrizes
Multiplicação de Matrizes
Multiplicacao de matrizes
Multiplicacao de matrizes
Matriz curric. matematica e.médio 2010
Matriz curric. matematica e.médio 2010
Plano de aula: Aspectos Didático-pedagógicos da Matemática no Ensino Médio II
Plano de aula: Aspectos Didático-pedagógicos da Matemática no Ensino Médio II
Planejamento Matrizes e determinantes
Planejamento Matrizes e determinantes
Semelhante a Multiplicação de matrizes em cuda
Grafos e Algoritimos - Dr. Julio Cesar de Araujo Menezes
Grafos e Algoritimos - Dr. Julio Cesar de Araujo Menezes
Julio Menezes
Funções (exercícios)
Funções (exercícios)
Kleber Miranda
4 tur11
4 tur11
Maria Quintela
Aplicação do k-NN utilizando Bitonic Sort
Aplicação do k-NN utilizando Bitonic Sort
Vinicius Coelho
Lista 1 - Robótica (Jim & Ronie)
Lista 1 - Robótica (Jim & Ronie)
Jim Naturesa
Gabarito funcoes
Gabarito funcoes
bferes
Semelhante a Multiplicação de matrizes em cuda
(6)
Grafos e Algoritimos - Dr. Julio Cesar de Araujo Menezes
Grafos e Algoritimos - Dr. Julio Cesar de Araujo Menezes
Funções (exercícios)
Funções (exercícios)
4 tur11
4 tur11
Aplicação do k-NN utilizando Bitonic Sort
Aplicação do k-NN utilizando Bitonic Sort
Lista 1 - Robótica (Jim & Ronie)
Lista 1 - Robótica (Jim & Ronie)
Gabarito funcoes
Gabarito funcoes
Último
Revolução russa e mexicana. Slides explicativos e atividades
Revolução russa e mexicana. Slides explicativos e atividades
FabianeMartins35
Slides Lição 5, Betel, Ordenança para uma vida de vigilância e oração, 2Tr24....
Slides Lição 5, Betel, Ordenança para uma vida de vigilância e oração, 2Tr24....
LuizHenriquedeAlmeid6
Slides sobre as Funções da Linguagem.pptx
Slides sobre as Funções da Linguagem.pptx
MauricioOliveira258223
Bloco de português com artigo de opinião 8º A, B 3.docx
Bloco de português com artigo de opinião 8º A, B 3.docx
kellyneamaral
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéis
ines09cachapa
Currículo - Ícaro Kleisson - Tutor acadêmico.pdf
Currículo - Ícaro Kleisson - Tutor acadêmico.pdf
Tutor de matemática Ícaro
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
LeloIurk1
Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)
ElliotFerreira
A QUATRO MÃOS - MARILDA CASTANHA . pdf
A QUATRO MÃOS - MARILDA CASTANHA . pdf
Ana Lemos
planejamento_estrategico_-_gestao_2021-2024_16015654.pdf
planejamento_estrategico_-_gestao_2021-2024_16015654.pdf
maurocesarpaesalmeid
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
azulassessoria9
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
azulassessoria9
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
LeloIurk1
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
JaineCarolaineLima
421243121-Apostila-Ensino-Religioso-Do-1-ao-5-ano.pdf
421243121-Apostila-Ensino-Religioso-Do-1-ao-5-ano.pdf
LeloIurk1
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: LEITURA DE IMAGENS, GRÁFICOS E MA...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: LEITURA DE IMAGENS, GRÁFICOS E MA...
azulassessoria9
CRUZADINHA - Leitura e escrita dos números
CRUZADINHA - Leitura e escrita dos números
Mary Alvarenga
apostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médio
rosenilrucks
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
LeloIurk1
Slides Lição 05, Central Gospel, A Grande Tribulação, 1Tr24.pptx
Slides Lição 05, Central Gospel, A Grande Tribulação, 1Tr24.pptx
LuizHenriquedeAlmeid6
Último
(20)
Revolução russa e mexicana. Slides explicativos e atividades
Revolução russa e mexicana. Slides explicativos e atividades
Slides Lição 5, Betel, Ordenança para uma vida de vigilância e oração, 2Tr24....
Slides Lição 5, Betel, Ordenança para uma vida de vigilância e oração, 2Tr24....
Slides sobre as Funções da Linguagem.pptx
Slides sobre as Funções da Linguagem.pptx
Bloco de português com artigo de opinião 8º A, B 3.docx
Bloco de português com artigo de opinião 8º A, B 3.docx
About Vila Galé- Cadeia Empresarial de Hotéis
About Vila Galé- Cadeia Empresarial de Hotéis
Currículo - Ícaro Kleisson - Tutor acadêmico.pdf
Currículo - Ícaro Kleisson - Tutor acadêmico.pdf
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
2° ANO - ENSINO FUNDAMENTAL ENSINO RELIGIOSO
Análise poema país de abril (Mauel alegre)
Análise poema país de abril (Mauel alegre)
A QUATRO MÃOS - MARILDA CASTANHA . pdf
A QUATRO MÃOS - MARILDA CASTANHA . pdf
planejamento_estrategico_-_gestao_2021-2024_16015654.pdf
planejamento_estrategico_-_gestao_2021-2024_16015654.pdf
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
Considere a seguinte situação fictícia: Durante uma reunião de equipe em uma...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: COMUNICAÇÃO ASSERTIVA E INTERPESS...
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ENSINO RELIGIOSO 7º ANO INOVE NA ESCOLA.pdf
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
ATIVIDADE - CHARGE.pptxDFGHJKLÇ~ÇLJHUFTDRSEDFGJHKLÇ
421243121-Apostila-Ensino-Religioso-Do-1-ao-5-ano.pdf
421243121-Apostila-Ensino-Religioso-Do-1-ao-5-ano.pdf
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: LEITURA DE IMAGENS, GRÁFICOS E MA...
PROVA - ESTUDO CONTEMPORÂNEO E TRANSVERSAL: LEITURA DE IMAGENS, GRÁFICOS E MA...
CRUZADINHA - Leitura e escrita dos números
CRUZADINHA - Leitura e escrita dos números
apostila projeto de vida 2 ano ensino médio
apostila projeto de vida 2 ano ensino médio
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
5 bloco 7 ano - Ensino Relogioso- Lideres Religiosos _ Passei Direto.pdf
Slides Lição 05, Central Gospel, A Grande Tribulação, 1Tr24.pptx
Slides Lição 05, Central Gospel, A Grande Tribulação, 1Tr24.pptx
Multiplicação de matrizes em cuda
1.
Multiplicação de Matrizes
em CUDA Divino César SoaresPontifícia Universidade Católica de Goiás (CMP/PUC-GO)
2.
3.
Gerar uma
matriz resultado C com as mesmas dimensões das matrizes A e B.
4.
Cada elemento
(i, j) da matriz C é o produto (interno) da linha i de A pela coluna j de B.
5.
Para cada
elemento (i, j) de C:for (k=1; k<=LARGURA; k++) C[i][j] += (A[i][k] * B[k][j]);
6.
7.
8.
9.
10.
11.
12.
13.
14.
Estrutura da Solução
Alocar memória na GPU. Copia dados de entrada. Da CPU para a GPU. Configura execução. Número de threads e blocos. Copia resultados. cudaMalloc((void **)&A_d, size_A); cudaMalloc((void**)&B_d, size_B); cudaMalloc((void**)&C_d, size_C); cudaMemcpy(A_d, A, size_A, cudaMemcpyHostToDevice); cudaMemcpy(B_d, B, size_B , cudaMemcpyHostToDevice); cudaMemcpy(C_d, C, size_C , cudaMemcpyHostToDevice); dim3 gride(X, Y)dim3 bloco(Z, W, K)meu_kernel<<<gride, bloco>>>(A, B, C); cudaMemcpy(C, C_d, size_C , cudaMemcpyDeviceToHost);
15.
Primeira Abordagem
16.
Kernel 1 dim3
gride(1, 1) dim3 bloco(4, 4, 1) dim3 gride(2, 1) dim3 bloco(4, 4, 1) dim3 gride(1, 1) dim3 bloco(30, 30, 1) Gride Gride Gride << Launcherror >>> Bloco com 600 threads Bloco 0 Bloco 0 Bloco 1
17.
Kernel 1 dim3
gride(1, 1) dim3 bloco(LARGURA, LARGURA, 1) Gride LARGURA LARGURA Bloco 0
18.
Kernel 1 dim3
gride(1, 1) dim3 bloco(LARGURA, LARGURA, 1) Gride __global__voidmulGpu(int *A[], int *B[], int *C[]) { int i = threadIdx.x; int j = threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } LARGURA LARGURA Bloco 0 Kernel 1: Multiplicação na GPU
19.
Kernel 1 1
Instante de tempo t=0 2 __global__voidmulGpu(int *A[], int *B[], int *C[]) { int i = threadIdx.x; int j = threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 1: Multiplicação na GPU 4 1 2 3
20.
Kernel 1 1
Instante de tempo t=1 2 __global__voidmulGpu(int *A[], int *B[], int *C[]) { int i = threadIdx.x; int j = threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 1: Multiplicação na GPU 4 1 2 3
21.
Kernel 1 1
Instante de tempo t=2 2 __global__voidmulGpu(int *A[], int *B[], int *C[]) { int i = threadIdx.x; int j = threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 1: Multiplicação na GPU 4 1 2 3
22.
Kernel 1 1
Instante de tempo t=L 2 __global__voidmulGpu(int *A[], int *B[], int *C[]) { int i = threadIdx.x; int j = threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 1: Multiplicação na GPU 4 1 2 3
23.
24.
Segunda Abordagem
25.
Kernel 2 dim3
gride(2, 2) dim3 bloco(15, 15, 1) dim3 gride(1, 1) dim3 bloco(30, 30, 1) Gride Gride << Launcherror >>> Bloco com 600 threads Bloco 0, 0 Bloco 0, 1 Bloco 1, 0 Bloco 1, 1
26.
Kernel 2 dim3
gride(2, 2) dim3 bloco(15, 15, 1) Gride Bloco 0, 0 Bloco 0, 1 225 threads por bloco.Total de 900 threads. Bloco 1, 0 Bloco 1, 1
27.
Kernel 2 dim3
gride(2, 2) dim3 bloco(15, 15, 1) Gride __global__void mulGpu2(int *A[], int *B[], int *C[]) { int i = blockIdx.x * SUB_LARGURA + threadIdx.x; int j = blockIdx.y * SUB_LARGURA + threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } Bloco 0, 0 Bloco 0, 1 Kernel 2: Multiplicação na GPU Bloco 1, 0 Bloco 1, 1
28.
Kernel 2 1
2 __global__void mulGpu2(int *A[], int *B[], int *C[]) { int i = blockIdx.x * SUB_LARGURA + threadIdx.x; int j = blockIdx.y * SUB_LARGURA + threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 2: Multiplicação na GPU 4 1 2 3
29.
Kernel 2 1
2 __global__void mulGpu2(int *A[], int *B[], int *C[]) { int i = blockIdx.x * SUB_LARGURA + threadIdx.x; int j = blockIdx.y * SUB_LARGURA + threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 2: Multiplicação na GPU 4 1 2 3
30.
Kernel 2 1
2 __global__void mulGpu2(int *A[], int *B[], int *C[]) { int i = blockIdx.x * SUB_LARGURA + threadIdx.x; int j = blockIdx.y * SUB_LARGURA + threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 2: Multiplicação na GPU 4 1 2 3
31.
Kernel 2 1
Instante de tempo t=L 2 __global__void mulGpu2(int *A[], int *B[], int *C[]) { int i = blockIdx.x * SUB_LARGURA + threadIdx.x; int j = blockIdx.y * SUB_LARGURA + threadIdx.y; for (int k=1; k<=LARGURA; k++) { C[i][j] += (A[i][k] * B[k][j]); } } 3 4 Kernel 2: Multiplicação na GPU 4 1 2 3
32.
33.
Dúvidas?
Baixar agora