Q.ANT Native Computing Toolkit 2.4.0
All you need for photonic computing
Loading...
Searching...
No Matches
qant_native_computing_toolkit_native.h
Go to the documentation of this file.
1#ifndef QANT_NATIVE_COMPUTING_TOOLKIT_NATIVE_H
2#define QANT_NATIVE_COMPUTING_TOOLKIT_NATIVE_H
3
10
11#include <stdint.h>
12
13#include <dlpack/dlpack.h>
14
16
17#ifdef __cplusplus
18namespace qant_native_computing_toolkit::native
19{
20 using ::qant_native_computing_toolkit::generic::QantMemoryHandle;
21
22 extern "C"
23 {
24#endif
25
37 DLManagedTensorVersioned *mul_npu(const uint32_t npu_id, DLManagedTensorVersioned const *us,
38 DLManagedTensorVersioned const *vs);
39
51 DLManagedTensorVersioned *calc_scaled_periodic_nl_fprop(const uint32_t npu_id, DLManagedTensorVersioned const *features, DLManagedTensorVersioned const *weights);
52
73 DLManagedTensorVersioned *linear_fprop(const uint32_t npu_id, DLManagedTensorVersioned const *features,
74 DLManagedTensorVersioned const *weights);
75
89 DLManagedTensorVersioned *linear_fprop_preloaded_weights(DLManagedTensorVersioned const *features,
90 QantMemoryHandle const *weights);
91
111 int linear_fprop_preloaded(QantMemoryHandle const *features, QantMemoryHandle const *weights,
112 QantMemoryHandle const *result);
113
114#ifdef __cplusplus
115 } // extern "C"
116} // namespace qant_native_computing_toolkit::native
117#endif
118
119#endif // QANT_NATIVE_COMPUTING_TOOLKIT_NATIVE_H
struct QantMemoryHandle QantMemoryHandle
Opaque handle to a block of device memory sized to hold a matrix.
Definition qant_native_computing_toolkit_generic.h:50
DLManagedTensorVersioned * linear_fprop(const uint32_t npu_id, DLManagedTensorVersioned const *features, DLManagedTensorVersioned const *weights)
Performs a linear forward propagation between input features and a weight matrix.
DLManagedTensorVersioned * mul_npu(const uint32_t npu_id, DLManagedTensorVersioned const *us, DLManagedTensorVersioned const *vs)
Multiplies two 1D Tensors element-wise.
DLManagedTensorVersioned * calc_scaled_periodic_nl_fprop(const uint32_t npu_id, DLManagedTensorVersioned const *features, DLManagedTensorVersioned const *weights)
Calculates a scaled periodic nonlinearity pairwise for all elements of features and weights .
int linear_fprop_preloaded(QantMemoryHandle const *features, QantMemoryHandle const *weights, QantMemoryHandle const *result)
Same as linear_fprop(), but features, weights and result all live in device memory.
DLManagedTensorVersioned * linear_fprop_preloaded_weights(DLManagedTensorVersioned const *features, QantMemoryHandle const *weights)
Same as linear_fprop(), but uses a weight matrix previously uploaded.