mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-17 18:40:28 +00:00
Doc TP API and cuda resources (#19172)
Doc TP API and cuda resources. --------- Co-authored-by: Randy Shuai <rashuai@microsoft.com>
This commit is contained in:
parent
e882d61f1f
commit
e679d998ad
2 changed files with 4 additions and 2 deletions
|
|
@ -201,5 +201,7 @@ int main() {
|
|||
|
||||
Note that `CreateThreadCustomized` and `JoinThreadCustomized`, once set, will be applied to both ORT intra op and inter op thread pools uniformly.
|
||||
|
||||
## Usage in custom ops
|
||||
Since 1.17, custom op developers are entitled to parallelize their cpu code with ort intra-op thread pool.
|
||||
|
||||
|
||||
Please refer to the [API](https://github.com/microsoft/onnxruntime/blob/rel-1.17.0/include/onnxruntime/core/session/onnxruntime_c_api.h#L4543), and [example](https://github.com/microsoft/onnxruntime/blob/rel-1.17.0/onnxruntime/test/testdata/custom_op_library/cpu/cpu_ops.cc#L87) for usage.
|
||||
|
|
@ -133,7 +133,7 @@ void KernelOne(const Ort::Custom::CudaContext& cuda_ctx,
|
|||
cuda_add(Z.NumberOfElement(), z_raw, X.Data(), Y.Data(), cuda_ctx.cuda_stream); // launch a kernel inside
|
||||
}
|
||||
```
|
||||
Details could be found [here](https://github.com/microsoft/onnxruntime/tree/rel-1.16.0/onnxruntime/test/testdata/custom_op_library/cuda).
|
||||
Full example could be found [here](https://github.com/microsoft/onnxruntime/tree/rel-1.17.0/onnxruntime/test/testdata/custom_op_library/cuda). To further facilitate development, a wide variety of cuda ep resources and configurations are exposed via CudaContext, please refer to the [header](https://github.com/microsoft/onnxruntime/blob/rel-1.17.0/include/onnxruntime/core/providers/cuda/cuda_resource.h#L8) for detail.
|
||||
|
||||
For ROCM, it is like:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue