Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] C-API documentation & generator #5736

Merged
merged 61 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e7d5d41
C-API documentation generator
PENGUINLIONG Aug 11, 2022
25a7abc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 11, 2022
6db53ec
Relocate C-API documentations
PENGUINLIONG Aug 12, 2022
0ca4749
Added category json
PENGUINLIONG Aug 12, 2022
2034acc
Rearrange
PENGUINLIONG Aug 12, 2022
30664c3
Enriched documentation
PENGUINLIONG Aug 12, 2022
76a719f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 12, 2022
4e78085
Fixed docs a bit
PENGUINLIONG Aug 12, 2022
cc29789
Inline symbol reference
PENGUINLIONG Aug 12, 2022
de78a20
Addressed review comment
PENGUINLIONG Aug 12, 2022
ea3d029
Field documentations
PENGUINLIONG Aug 12, 2022
4e4a929
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 12, 2022
67815c5
Improved docs
PENGUINLIONG Aug 13, 2022
0bba11f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 12, 2022
34b18e0
Vulkan C-API docs
PENGUINLIONG Aug 14, 2022
79eff3c
Minor fixes
PENGUINLIONG Aug 14, 2022
acc28ba
Reference links
PENGUINLIONG Aug 14, 2022
2c002ae
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
0fdc6d2
Fixed href to device commands
PENGUINLIONG Aug 14, 2022
197d3d4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2022
23bcdd7
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
b95c31c
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
fd51672
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
0c3eeac
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
d63c12d
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
0724052
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
fb42319
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
ddda967
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
6d4eb6c
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
7535037
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
ab34823
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
9e3daf8
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
bc66dd5
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
881f4a0
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
662e6c3
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
81c10e8
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
d1a6219
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
a77648b
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
de9dbbd
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
e6ad433
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
4cdb41e
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
1449e05
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2022
633d9f5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2022
446b784
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 23, 2022
97c6060
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2022
2fd41a0
Editorial changes
PENGUINLIONG Sep 23, 2022
03d51ba
Merge branch 'capi-docs1' of https://github.com/PENGUINLIONG/taichi i…
PENGUINLIONG Sep 23, 2022
a2041a3
Finalizing editorial changes
PENGUINLIONG Sep 23, 2022
aa64467
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 23, 2022
496de89
Update c_api/docs/taichi/taichi_core.h.md
PENGUINLIONG Sep 24, 2022
42d28cd
Editorial updates
PENGUINLIONG Sep 24, 2022
e7b8cb2
Merge branch 'capi-docs1' of https://github.com/PENGUINLIONG/taichi i…
PENGUINLIONG Sep 24, 2022
d923943
Added docs for new interfaces
PENGUINLIONG Sep 24, 2022
9b3cc34
Fixed docs
PENGUINLIONG Sep 24, 2022
3e202ae
Editorial updates
PENGUINLIONG Sep 24, 2022
e600355
Editorial updates
PENGUINLIONG Sep 24, 2022
7da8983
Editorial update
PENGUINLIONG Sep 24, 2022
5861295
Editorial update
PENGUINLIONG Sep 24, 2022
01597b9
Editorial update
PENGUINLIONG Sep 25, 2022
5a495fb
Editorial update
PENGUINLIONG Sep 25, 2022
59c8faa
Insert C-API references after 'Deployment'
PENGUINLIONG Sep 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
558 changes: 558 additions & 0 deletions c_api/docs/taichi/taichi_core.h.md

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions c_api/docs/taichi/taichi_vulkan.h.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
sidebar_positions: 2
---

# Vulkan Backend Features

Taichi's Vulkan API gives you further control over the Vulkan version and extension requirements and allows you to interop with external Vulkan applications with shared resources.

## API Reference

`structure.vulkan_runtime_interop_info`

Necessary detail to share the same Vulkan runtime between Taichi and external procedures.

- `structure.vulkan_runtime_interop_info.get_instance_proc_addr`: Pointer to Vulkan loader function `vkGetInstanceProcAddr`.
- `structure.vulkan_runtime_interop_info.api_version`: Target Vulkan API version.
- `structure.vulkan_runtime_interop_info.instance`: Vulkan instance handle.
- `structure.vulkan_runtime_interop_info.physical_device`: Vulkan physical device handle.
- `structure.vulkan_runtime_interop_info.device`: Vulkan logical device handle.
- `structure.vulkan_runtime_interop_info.compute_queue`: Vulkan queue handle created in the queue family at `structure.vulkan_runtime_interop_info.compute_queue_family_index`.
- `structure.vulkan_runtime_interop_info.compute_queue_family_index`: Index of a Vulkan queue family with the `VK_QUEUE_COMPUTE_BIT` set.
- `structure.vulkan_runtime_interop_info.graphics_queue`: Vulkan queue handle created in the queue family at `structure.vulkan_runtime_interop_info.graphics_queue_family_index`.
- `structure.vulkan_runtime_interop_info.graphics_queue_family_index`: Index of a Vulkan queue family with the `VK_QUEUE_GRAPHICS_BIT` set.

**NOTE** `structure.vulkan_runtime_interop_info.compute_queue` and `structure.vulkan_runtime_interop_info.graphics_queue` can be the same if the queue family have `VK_QUEUE_COMPUTE_BIT` and `VK_QUEUE_GRAPHICS_BIT` set at the same tiem.

`structure.vulkan_memory_interop_info`

Necessary detail to share the same piece of Vulkan buffer between Taichi and external procedures.

- `structure.vulkan_memory_interop_info.buffer`: Vulkan buffer.
- `structure.vulkan_memory_interop_info.size`: Size of the piece of memory in bytes.
- `structure.vulkan_memory_interop_info.usage`: Vulkan buffer usage. In most of the cases, Taichi requires the `VK_BUFFER_USAGE_STORAGE_BUFFER_BIT`.

`structure.vulkan_image_interop_info`

Necessary detail to share the same piece of Vulkan image between Taichi and external procedures.

- `structure.vulkan_image_interop_info.image`: Vulkan image.
- `structure.vulkan_image_interop_info.image_type`: Vulkan image allocation type.
- `structure.vulkan_image_interop_info.format`: Pixel format.
- `structure.vulkan_image_interop_info.extent`: Image extent.
- `structure.vulkan_image_interop_info.mip_level_count`: Number of mip-levels of the image.
- `structure.vulkan_image_interop_info.array_layer_count`: Number of array layers.
- `structure.vulkan_image_interop_info.sample_count`: Number of samples per pixel.
- `structure.vulkan_image_interop_info.tiling`: Image tiling.
- `structure.vulkan_image_interop_info.usage`: Vulkan image usage. In most cases, Taichi requires the `VK_IMAGE_USAGE_STORAGE_BIT` and the `VK_IMAGE_USAGE_SAMPLED_BIT`.

`structure.vulkan_event_interop_info`

Necessary detail to share the same Vulkan event synchronization primitive between Taichi and the user application.

- `structure.vulkan_event_interop_info.event`: Vulkan event handle.

`function.create_vulkan_runtime`

Creates a Vulkan Taichi runtime with user-controlled capability settings.

`function.import_vulkan_runtime`

Imports the Vulkan runtime owned by Taichi to external procedures.

`function.export_vulkan_runtime`

Exports a Vulkan runtime from external procedures to Taichi.

`function.import_vulkan_memory`

Imports the Vulkan buffer owned by Taichi to external procedures.

`function.export_vulkan_memory`

Exports a Vulkan buffer from external procedures to Taichi.

`function.import_vulkan_image`

Imports the Vulkan image owned by Taichi to external procedures.

`function.export_vulkan_image`

Exports a Vulkan image from external procedures to Taichi.

`function.import_vulkan_event`

Imports the Vulkan event owned by Taichi to external procedures.

`function.export_vulkan_event`

Exports a Vulkan event from external procedures to Taichi.
4 changes: 4 additions & 0 deletions c_api/taichi.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@
"name": "format",
"type": "enumeration.format"
},
{
"name": "export_sharing",
"type": "alias.bool"
},
{
"name": "usage",
"type": "bit_field.image_usage"
Expand Down
4 changes: 4 additions & 0 deletions docs/lang/articles/c-api/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"label": "Taichi Runtime C-API",
"position": 11
}
Loading