Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/AnswerDotAI/gpu.cpp
/ functions
Functions
200 in github.com/AnswerDotAI/gpu.cpp
⨍
Functions
200
◇
Types & classes
52
↓ 248 callers
Function
createTensor
* @brief Tensor factory function to create a tensor (a Tensor type is simply * an Array with an N-dimensional Shape specification) on the GPU. The t
gpu.hpp:575
↓ 141 callers
Function
LOG
utils/logging.hpp:51
↓ 101 callers
Function
toString
* @brief Converts NumType to string. */
gpu.hpp:223
↓ 82 callers
Function
createKernel
* @brief A factory function to create a kernel on the GPU. The kernel is * created with the given WGSL code, input tensors, output tensor, and * opt
gpu.hpp:1215
↓ 74 callers
Function
toCPU
* @brief Copies data from a GPU buffer to CPU memory. * @param[in] ctx Context instance to manage the operation * @param[in] tensor Tensor instance
gpu.hpp:997
↓ 57 callers
Function
cdiv
* @brief Ceiling division. */
gpu.hpp:1172
↓ 49 callers
Function
wait
gpu.hpp:978
↓ 48 callers
Function
dispatchKernel
* @brief Asynchronously submits a kernel to the GPU queue for execution. * It also sets up a callback to notify when the kernel has finished executin
gpu.hpp:1429
↓ 30 callers
Function
createContext
* @brief Factory function to create a GPU context, which aggregates WebGPU API * handles to interact with the GPU including the instance, adapter, de
gpu.hpp:774
↓ 30 callers
Function
replaceAll
* @brief simple in-place string replacement helper function for substituting * placeholders in a WGSL string template. * * Note this is not meant t
gpu.hpp:275
↓ 29 callers
Function
setLogLevel
* @brief Set the log level of the default logger. * @param level The log level to set. */
utils/logging.hpp:107
↓ 26 callers
Function
halfToFloat
* @brief Converts a 16-bit half-precision float to a 32-bit float. * * Based on Mike Acton's half.c implementation. */
numeric_types/half.hpp:229
↓ 22 callers
Function
printResult
numeric_types/half.cpp:24
↓ 18 callers
Function
testRoundTrip
numeric_types/half.cpp:49
↓ 14 callers
Function
check
* Convenience function to check if a condition is true, if not log an error * message and exit. * * @param condition: The condition to check. * @p
examples/webgpu_from_scratch/run.cpp:41
↓ 12 callers
Function
halfFromFloat
* @brief Converts a 32-bit float to a 16-bit half-precision float. * * Based on Mike Acton's half.c implementation. */
numeric_types/half.hpp:106
↓ 10 callers
Function
check
* @brief Checks a condition and logs an error message if the condition is * false. * @param[in] condition The condition to check. * @param[in] mess
gpu.hpp:743
↓ 8 callers
Function
randint
* @brief Populate the array with random integers. * @param a The array to populate. * @param N The number of elements in the array. * @param gen Th
utils/array_utils.hpp:182
↓ 8 callers
Function
range
* @brief Populate the array with a range of values. This is mostly for testing * purposes. * @param input The array to populate. * @param N The num
utils/array_utils.hpp:150
↓ 7 callers
Function
isclose
* @brief Determine if the values of two arrays are close to each other. * @param a The first array. * @param b The second array. * @param n The num
utils/array_utils.hpp:315
↓ 7 callers
Function
processEvents
gpu.hpp:504
↓ 6 callers
Function
size
* @brief Returns the number of elements in a tensor with the given shape, * which is equal to the product of the dimensions. * @param[in] shape Shap
gpu.hpp:86
↓ 5 callers
Function
check
experimental/legacy/audio/run.cpp:72
↓ 5 callers
Function
matmul_backward
experimental/kernels/ops.cpp:196
↓ 5 callers
Function
matmul_forward
experimental/kernels/ops.cpp:159
↓ 5 callers
Function
randn
* @brief Populate the array with random floats, generated from a Gaussian distribution. * @param a The array to populate. * @param N The number of e
utils/array_utils.hpp:213
↓ 5 callers
Function
resetCommandBuffer
* @brief Resets the command buffer in preparation for a kernel dispatch. * Since command buffers are consumed upon submission, this function is used
gpu.hpp:1145
↓ 5 callers
Function
toGPU
* @brief Copies data from CPU memory to a GPU buffer. The toGPU overloads are * effectively a convenience wrapper around the WebGPU API call * wgpuQ
gpu.hpp:1096
↓ 4 callers
Function
approximatelyEqual
numeric_types/half.cpp:20
↓ 4 callers
Function
loopUnrolling
Loop-unrolling optimization with regex Note: Be cautious, as it does not correctly recognize comments or lexical tokens.
experimental/wgsl.h:13
↓ 4 callers
Method
updateIcon
()
docs/doxygen-awesome/doxygen-awesome-darkmode-toggle.js:148
↓ 3 callers
Method
enableDarkMode
(enable)
docs/doxygen-awesome/doxygen-awesome-darkmode-toggle.js:122
↓ 3 callers
Function
gpt2_forward
experimental/kernels/gpt2_webgpu.cpp:307
↓ 3 callers
Function
layernorm_backward
experimental/kernels/ops.cpp:121
↓ 3 callers
Function
layernorm_forward
experimental/kernels/ops.cpp:85
↓ 3 callers
Function
loadKernelCode
examples/shadertui/run.cpp:43
↓ 3 callers
Function
sigmoid
experimental/legacy/audio/run.cpp:20
↓ 3 callers
Function
transpose
* @brief Transpose a matrix. * @param input The input matrix. * @param output The output matrix. * @param M The number of rows in the input matrix.
utils/array_utils.hpp:268
↓ 2 callers
Function
createMatmul
experimental/legacy/transformer/run.cpp:154
↓ 2 callers
Function
getCurrentTimeInMilliseconds
examples/render/run.cpp:83
↓ 2 callers
Function
gpt2_zero_grad
experimental/kernels/gpt2_webgpu.cpp:455
↓ 2 callers
Function
gpu_alloc
experimental/kernels/gpt2_webgpu.cpp:203
↓ 2 callers
Function
malloc_and_point_activations
experimental/kernels/gpt2_webgpu.cpp:174
↓ 2 callers
Function
malloc_and_point_parameters
allocate memory for the parameters and point the individual tensors to the right places
experimental/kernels/gpt2_webgpu.cpp:93
↓ 2 callers
Method
onSystemPreferenceChanged
()
docs/doxygen-awesome/doxygen-awesome-darkmode-toggle.js:134
↓ 2 callers
Function
residual_backward
experimental/kernels/ops.cpp:358
↓ 2 callers
Function
residual_forward
experimental/kernels/ops.cpp:342
↓ 2 callers
Function
runTest
examples/matmul/run.cpp:783
↓ 1 callers
Function
FreeTensor
* @brief Frees a tensor resource and updates the tensor pool. * * Only needed if the use case requires manually managing resource lifetimes of * GP
gpu.hpp:705
↓ 1 callers
Function
MatmulShader
Generates KernelCode instance for all matmul kernels - pass in * the template code via `shaderRaw`. * * This is intended to be run ahead of time, s
experimental/legacy/transformer/shaders.h:166
↓ 1 callers
Function
__builtin_clz
numeric_types/half.hpp:13
↓ 1 callers
Function
attention_backward
experimental/kernels/ops.cpp:272
↓ 1 callers
Function
attention_forward
experimental/kernels/ops.cpp:235
↓ 1 callers
Function
checkCPU
examples/matmul/run.cpp:663
↓ 1 callers
Function
check_os
(os_name)
setup.py:46
↓ 1 callers
Function
copy_file
(src, dst)
examples/shadertui/script.py:24
↓ 1 callers
Function
createMatmul1
examples/matmul/run.cpp:68
↓ 1 callers
Function
createMatmul2
examples/matmul/run.cpp:126
↓ 1 callers
Function
createMatmul3
examples/matmul/run.cpp:228
↓ 1 callers
Function
createMatmul4
examples/matmul/run.cpp:340
↓ 1 callers
Function
createMatmulWithTranspose
examples/matmul/run.cpp:581
↓ 1 callers
Function
createMatmulWithVectorization
examples/matmul/run.cpp:459
↓ 1 callers
Function
createNoOp
examples/matmul/run.cpp:629
↓ 1 callers
Function
createTransformer
experimental/legacy/transformer/run.cpp:112
↓ 1 callers
Function
createTranspose1
examples/transpose/run.cpp:31
↓ 1 callers
Function
createTranspose2
examples/transpose/run.cpp:81
↓ 1 callers
Function
crossentropy_forward
experimental/kernels/ops.cpp:398
↓ 1 callers
Function
crossentropy_softmax_backward
experimental/kernels/ops.cpp:429
↓ 1 callers
Function
download_dawn
(os_name)
setup.py:55
↓ 1 callers
Function
download_file
(url, output_filename)
setup.py:23
↓ 1 callers
Function
encoder_backward
experimental/kernels/ops.cpp:51
↓ 1 callers
Function
encoder_forward
experimental/kernels/ops.cpp:12
↓ 1 callers
Function
fill_in_activation_sizes
experimental/kernels/gpt2_webgpu.cpp:144
↓ 1 callers
Function
fill_in_parameter_sizes
experimental/kernels/gpt2_webgpu.cpp:69
↓ 1 callers
Function
gelu_backward
experimental/kernels/ops.cpp:326
↓ 1 callers
Function
gelu_forward
experimental/kernels/ops.cpp:311
↓ 1 callers
Function
getCurrentTimeInMilliseconds
examples/shadertui/run.cpp:36
↓ 1 callers
Function
get_os_name
()
setup.py:8
↓ 1 callers
Function
gpt2_backward
experimental/kernels/gpt2_webgpu.cpp:460
↓ 1 callers
Function
gpt2_build_from_checkpoint
experimental/kernels/gpt2_webgpu.cpp:240
↓ 1 callers
Function
gpt2_free
experimental/kernels/gpt2_webgpu.cpp:610
↓ 1 callers
Function
gpt2_update
experimental/kernels/gpt2_webgpu.cpp:582
↓ 1 callers
Function
initData
examples/matmul/run.cpp:638
↓ 1 callers
Function
initData
examples/transpose/run.cpp:105
↓ 1 callers
Function
main
()
setup.py:106
↓ 1 callers
Function
matmulf16_forward_cpu
examples/matmul/run.cpp:24
↓ 1 callers
Method
onUserPreferenceChanged
()
docs/doxygen-awesome/doxygen-awesome-darkmode-toggle.js:139
↓ 1 callers
Function
puzzle1
examples/gpu_puzzles/key.cpp:51
↓ 1 callers
Function
puzzle1
examples/gpu_puzzles/run.cpp:48
↓ 1 callers
Function
puzzle10
examples/gpu_puzzles/key.cpp:413
↓ 1 callers
Function
puzzle11
examples/gpu_puzzles/key.cpp:482
↓ 1 callers
Function
puzzle12
examples/gpu_puzzles/key.cpp:545
↓ 1 callers
Function
puzzle13
examples/gpu_puzzles/key.cpp:611
↓ 1 callers
Function
puzzle14
examples/gpu_puzzles/key.cpp:685
↓ 1 callers
Function
puzzle2
examples/gpu_puzzles/key.cpp:78
↓ 1 callers
Function
puzzle3
examples/gpu_puzzles/key.cpp:104
↓ 1 callers
Function
puzzle4
examples/gpu_puzzles/key.cpp:137
↓ 1 callers
Function
puzzle5
examples/gpu_puzzles/key.cpp:176
↓ 1 callers
Function
puzzle6
examples/gpu_puzzles/key.cpp:216
↓ 1 callers
Function
puzzle7
examples/gpu_puzzles/key.cpp:257
next →
1–100 of 200, ranked by callers