Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooVDTHeaders.h
Go to the documentation of this file.
1// Author: Stephan Hageboeck, CERN 2 Sep 2019
2
3/*****************************************************************************
4 * RooFit
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2019, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17#ifndef ROOFIT_BATCHCOMPUTE_ROOVDTHEADERS_H
18#define ROOFIT_BATCHCOMPUTE_ROOVDTHEADERS_H
19
20/*
21 * VDT headers for RooFit. Since RooFit cannot directly depend on VDT (it might not be available),
22 * this layer can be used to switch between different implementations.
23 */
24
25
26#if defined(R__HAS_VDT)
27#include "vdt/exp.h"
28#include "vdt/log.h"
29#include "vdt/sqrt.h"
30
31namespace RooBatchCompute{
32
33inline double fast_exp(double x) {
34 return vdt::fast_exp(x);
35}
36
37inline double fast_log(double x) {
38 return vdt::fast_log(x);
39}
40
41inline double fast_isqrt(double x) {
42 return vdt::fast_isqrt(x);
43}
44
45}
46
47#else
48#include <cmath>
49
50namespace RooBatchCompute{
51
52inline double fast_exp(double x) {
53 return std::exp(x);
54}
55
56inline double fast_log(double x) {
57 return std::log(x);
58}
59
60inline double fast_isqrt(double x) {
61 return 1/std::sqrt(x);
62}
63
64}
65
66#endif
67
68
69#endif /* ROOFIT_BATCHCOMPUTE_ROOVDTHEADERS_H_ */
Double_t x[n]
Definition legend1.C:17
Namespace for dispatching RooFit computations to various backends.
double fast_log(double x)
double fast_exp(double x)
double fast_isqrt(double x)