clQMC
An OpenCL library for quasi-Monte Carlo methods
latticerule.h
Go to the documentation of this file.
1 /*
2  * Authors:
3  *
4  * David Munger <mungerd@iro.umontreal.ca> (2015)
5  * Pierre L'Ecuyer <lecuyer@iro.umontreal.ca> (2015)
6  *
7  */
8 
13 #pragma once
14 #ifndef CLQMC_LATTICERULE_H
15 #define CLQMC_LATTICERULE_H
16 
17 #include <clQMC/clQMC.h>
18 #include <stdio.h>
19 
20 struct clqmcLatticeRule_;
21 
27 typedef struct clqmcLatticeRule_ clqmcLatticeRule;
28 
29 
30 struct clqmcLatticeRuleStream_;
31 
39 typedef struct clqmcLatticeRuleStream_ clqmcLatticeRuleStream;
40 
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
49 cl_uint clqmcLatticeRuleNumPoints(const clqmcLatticeRule* lattice);
50 
54 cl_uint clqmcLatticeRuleDimension(const clqmcLatticeRule* lattice);
55 
56 #define clqmcLatticeRuleCreate _CLQMC_TAG_FPTYPE(clqmcLatticeRuleCreate)
57 
70 clqmcLatticeRule* clqmcLatticeRuleCreate (cl_uint numPoints, cl_uint dimension, const cl_int* genVec, size_t* objectSize, clqmcStatus* err);
71 clqmcLatticeRule* clqmcLatticeRuleCreate_clqmc_float (cl_uint numPoints, cl_uint dimension, const cl_int* genVec, size_t* objectSize, clqmcStatus* err);
72 clqmcLatticeRule* clqmcLatticeRuleCreate_clqmc_double(cl_uint numPoints, cl_uint dimension, const cl_int* genVec, size_t* objectSize, clqmcStatus* err);
73 
91 clqmcLatticeRule* clqmcLatticeRuleCreateKorobov(cl_uint numPoints, cl_uint dimension, cl_int gen, size_t* objectSize, clqmcStatus* err);
92 
96 clqmcStatus clqmcLatticeRuleDestroy(clqmcLatticeRule* lattice);
97 
101 clqmcStatus clqmcLatticeRuleWriteInfo(const clqmcLatticeRule* lattice, FILE* file);
102 
103 #define clqmcLatticeRuleCreateStream _CLQMC_TAG_FPTYPE(clqmcLatticeRuleCreateStream)
104 #define clqmcLatticeRuleCreateOverStream _CLQMC_TAG_FPTYPE(clqmcLatticeRuleCreateOverStream)
105 #define clqmcLatticeRuleNextCoordinate _CLQMC_TAG_FPTYPE(clqmcLatticeRuleNextCoordinate)
106 #define clqmcLatticeRuleNextPoint _CLQMC_TAG_FPTYPE(clqmcLatticeRuleNextPoint)
107 
111 CLQMCAPI clqmcLatticeRuleStream* clqmcLatticeRuleCreateStream (const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const _CLQMC_FPTYPE* shift, clqmcStatus* err);
112 CLQMCAPI clqmcLatticeRuleStream* clqmcLatticeRuleCreateStream_clqmc_float (const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const cl_float* shift, clqmcStatus* err);
113 CLQMCAPI clqmcLatticeRuleStream* clqmcLatticeRuleCreateStream_clqmc_double(const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const cl_double* shift, clqmcStatus* err);
114 
122 CLQMCAPI clqmcStatus clqmcLatticeRuleCreateOverStream (clqmcLatticeRuleStream* stream, const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const _CLQMC_FPTYPE* shift);
123 CLQMCAPI clqmcStatus clqmcLatticeRuleCreateOverStream_clqmc_float (clqmcLatticeRuleStream* stream, const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const cl_float* shift);
124 CLQMCAPI clqmcStatus clqmcLatticeRuleCreateOverStream_clqmc_double(clqmcLatticeRuleStream* stream, const clqmcLatticeRule* lattice, cl_uint partCount, cl_uint partIndex, const cl_double* shift);
125 
129 CLQMCAPI clqmcStatus clqmcLatticeRuleDestroyStream(clqmcLatticeRuleStream* stream);
130 
134 CLQMCAPI _CLQMC_FPTYPE clqmcLatticeRuleNextCoordinate (clqmcLatticeRuleStream* stream);
135 CLQMCAPI cl_float clqmcLatticeRuleNextCoordinate_clqmc_float (clqmcLatticeRuleStream* stream);
136 CLQMCAPI cl_double clqmcLatticeRuleNextCoordinate_clqmc_double(clqmcLatticeRuleStream* stream);
137 
141 CLQMCAPI cl_uint clqmcLatticeRuleNextPoint (clqmcLatticeRuleStream* stream, clqmc_fptype* coords);
142 CLQMCAPI cl_uint clqmcLatticeRuleNextPoint_clqmc_float (clqmcLatticeRuleStream* stream, clqmc_fptype* coords);
143 CLQMCAPI cl_uint clqmcLatticeRuleNextPoint_clqmc_double(clqmcLatticeRuleStream* stream, clqmc_fptype* coords);
144 
148 CLQMCAPI cl_uint clqmcLatticeRuleForwardToNextPoint(clqmcLatticeRuleStream* stream);
149 
153 CLQMCAPI cl_uint clqmcLatticeRuleCurrentPointIndex(const clqmcLatticeRuleStream* stream);
154 
158 CLQMCAPI cl_uint clqmcLatticeRuleCurrentCoordIndex(const clqmcLatticeRuleStream* stream);
159 
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif
clqmcLatticeRule * clqmcLatticeRuleCreate(cl_uint numPoints, cl_uint dimension, const cl_int *genVec, size_t *objectSize, clqmcStatus *err)
Create a new rank-1 lattice rule.
clqmcLatticeRule * clqmcLatticeRuleCreateKorobov(cl_uint numPoints, cl_uint dimension, cl_int gen, size_t *objectSize, clqmcStatus *err)
Create a new Korobov lattice rule.
CLQMCAPI clqmcLatticeRuleStream * clqmcLatticeRuleCreateStream(const clqmcLatticeRule *lattice, cl_uint partCount, cl_uint partIndex, const _CLQMC_FPTYPE *shift, clqmcStatus *err)
Attach a new stream to a point set object.
CLQMCAPI cl_uint clqmcLatticeRuleCurrentCoordIndex(const clqmcLatticeRuleStream *stream)
Return the current coordinate index of a stream [device].
CLQMCAPI cl_uint clqmcLatticeRuleCurrentPointIndex(const clqmcLatticeRuleStream *stream)
Return the current point index of a stream [device].
clqmcStatus clqmcLatticeRuleWriteInfo(const clqmcLatticeRule *lattice, FILE *file)
Write information about a point set object.
CLQMCAPI cl_uint clqmcLatticeRuleNextPoint(clqmcLatticeRuleStream *stream, clqmc_fptype *coords)
Retrieve all coordinates of the next point [device].
CLQMCAPI _CLQMC_FPTYPE clqmcLatticeRuleNextCoordinate(clqmcLatticeRuleStream *stream)
Return the value of the next coordinate [device].
CLQMCAPI cl_uint clqmcLatticeRuleForwardToNextPoint(clqmcLatticeRuleStream *stream)
Advance a stream to the next point [device].
CLQMCAPI clqmcStatus clqmcLatticeRuleDestroyStream(clqmcLatticeRuleStream *stream)
Destroy a stream object.
cl_uint clqmcLatticeRuleNumPoints(const clqmcLatticeRule *lattice)
Return the number of point in the point set [device].
CLQMCAPI clqmcStatus clqmcLatticeRuleCreateOverStream(clqmcLatticeRuleStream *stream, const clqmcLatticeRule *lattice, cl_uint partCount, cl_uint partIndex, const _CLQMC_FPTYPE *shift)
Attach a new stream to a point set object in already allocated memory [device].
clqmcStatus clqmcLatticeRuleDestroy(clqmcLatticeRule *lattice)
Destroy a point set object.
Library definitions.
cl_uint clqmcLatticeRuleDimension(const clqmcLatticeRule *lattice)
Return the dimension of the point set [device].