Skip to content

Commit 1b398c8

Browse files
authored
Merge pull request #140 from OptiQS-Lab/editorial-updates
Editorial updates
2 parents ce495c8 + 0e2bf4b commit 1b398c8

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Gpufit/java/gpufit/.gradle
99
Gpufit/java/gpufit/build
1010
Gpufit/java/gpufit/out
1111

12-
# docs
12+
# build folders
13+
build/
1314
/docs/_build
1415

Gpufit/models/linear_1d.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ __device__ void calculate_linear1d(
108108

109109
// derivatives
110110

111-
REAL * current_derivatives = derivative + point_index;
112-
current_derivatives[0 * n_points] = 1;
113-
current_derivatives[1 * n_points] = x;
111+
REAL * current_derivative = derivative + point_index;
112+
current_derivative[0 * n_points] = 1;
113+
current_derivative[1 * n_points] = x;
114114
}
115115

116116
#endif

docs/customization.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ of model parameters and dimensions must be specified as well.
2828
Detailed step by step instructions for adding a model function are given below.
2929

3030
1. Define an additional model ID in file constants.h_. When using the language bindings, the model ID must also be added for Python (in gpufit.py), Matlab (in ModelID.m), Java (in Model.java).
31-
2. Implement a CUDA device function within a newly created .cuh file in folder Gpufit/Gpufit/models according to the following template.
31+
2. Implement a CUDA device function within a newly created .cuh file in folder Gpufit/Gpufit/models according to the following template. (The REAL type is defined in Gpufit/definitions.h to switch between single and double precision.)
3232

3333
.. code-block:: cuda
3434
3535
__device__ void ... ( // ... = function name
36-
float const * parameters,
36+
REAL const * parameters,
3737
int const n_fits,
3838
int const n_points,
39-
float * value,
40-
float * derivative,
39+
REAL * value,
40+
REAL * derivative,
4141
int const point_index,
4242
int const fit_index,
4343
int const chunk_index,
4444
char * user_info,
4545
std::size_t const user_info_size)
4646
{
47-
///////////////////////////// value //////////////////////////////
47+
// value
4848
4949
value[point_index] = ... ; // formula calculating fit model values
5050
51-
/////////////////////////// derivative ///////////////////////////
52-
float * current_derivative = derivative + point_index;
51+
// derivative
52+
REAL * current_derivative = derivative + point_index;
5353
5454
current_derivative[0 * n_points] = ... ; // formula calculating derivative values with respect to parameters[0]
5555
current_derivative[1 * n_points] = ... ; // formula calculating derivative values with respect to parameters[1]

0 commit comments

Comments
 (0)