ROOT
v6-34
Reference Guide
Loading...
Searching...
No Matches
OutputFunctions.cu
Go to the documentation of this file.
1
// @(#)root/tmva/tmva/dnn:$Id$
2
// Author: Simon Pfreundschuh 11/07/16
3
4
/*************************************************************************
5
* Copyright (C) 2016, Simon Pfreundschuh *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
////////////////////////////////////////////////////////////////
13
// Explicit instantiation of the Reference architecture class //
14
// template for Double_t scalar types. //
15
////////////////////////////////////////////////////////////////
16
17
#include "
TMVA/DNN/Architectures/Cuda.h
"
18
#include "
TMVA/DNN/Architectures/Cuda/Device.h
"
19
#include "
Kernels.cuh
"
20
21
namespace
TMVA
22
{
23
namespace
DNN
24
{
25
26
template
<
typename
AFloat>
27
void
TCuda<AFloat>::Sigmoid
(
TCudaMatrix<AFloat>
& B,
28
const
TCudaMatrix<AFloat>
& A)
29
{
30
dim3
blockDims
=
TDevice::BlockDims2D
();
31
dim3
gridDims
=
TDevice::GridDims2D
(B);
32
cudaStream_t s = A.GetComputeStream();
33
::TMVA::DNN::Cuda::Sigmoid<<<gridDims, blockDims, 0, s>>>(B.GetDataPointer(),
34
A.GetDataPointer(),
35
(
int
) A.GetNrows(),
36
(
int
) A.GetNcols());
37
B.SetComputeStream(s);
38
}
39
40
//______________________________________________________________________________
41
template
<
typename
AFloat>
42
void
TCuda<AFloat>::Softmax
(
TCudaMatrix<AFloat>
& B,
43
const
TCudaMatrix<AFloat>
& A)
44
{
45
dim3
blockDims
=
TDevice::BlockDims1D
();
46
dim3
gridDims
=
TDevice::GridDims1D
(B);
47
cudaStream_t s = A.GetComputeStream();
48
::TMVA::DNN::Cuda::Softmax<<<gridDims, blockDims, 0, s>>>(B.GetDataPointer(),
49
A.GetDataPointer(),
50
(
int
) A.GetNrows(),
51
(
int
) A.GetNcols());
52
B.SetComputeStream(s);
53
}
54
55
}
// namespace DNN
56
}
// namespace TMVA
Cuda.h
Device.h
Kernels.cuh
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TMVA::DNN::TCuda::Sigmoid
static void Sigmoid(Tensor_t &B)
TMVA::DNN::TCuda::Softmax
static void Softmax(Matrix_t &YHat, const Matrix_t &)
Definition
OutputFunctions.cu:42
TMVA::DNN::TDevice::BlockDims2D
static dim3 BlockDims2D()
Definition
Device.h:55
TMVA::DNN::TDevice::GridDims2D
static dim3 GridDims2D(int nrows, int ncols)
Definition
Device.h:74
TMVA::DNN::TDevice::BlockDims1D
static dim3 BlockDims1D()
Definition
Device.h:48
TMVA::DNN::TDevice::GridDims1D
static dim3 GridDims1D(const AMatrix &A)
Definition
Device.h:63
int
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
tmva
tmva
src
DNN
Architectures
Cuda
OutputFunctions.cu
ROOT v6-34 - Reference Guide Generated on Wed Jan 29 2025 04:46:28 (GVA Time) using Doxygen 1.10.0