Skip to content

Commit 57fda1a

Browse files
author
Henry Linjamäki
committed
* translate -> import/export
* Fix typos.
1 parent 6402f59 commit 57fda1a

2 files changed

Lines changed: 39 additions & 39 deletions

File tree

ext/cl_exp_tensor.asciidoc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ object.
290290

291291
[source,c]
292292
----
293-
cl_int clEnqueueTranslateFromTensor(
293+
cl_int clEnqueueImportFromTensor(
294294
cl_command_queue command_queue,
295295
cl_tensor tensor,
296296
cl_bool blocking_command,
@@ -307,7 +307,7 @@ cl_int clEnqueueTranslateFromTensor(
307307

308308
[source,c]
309309
----
310-
cl_int clEnqueueTranslateToTensor(
310+
cl_int clEnqueueExportToTensor(
311311
cl_command_queue command_queue,
312312
cl_tensor tensor,
313313
cl_bool blocking_command,
@@ -376,10 +376,10 @@ cl_int clEnqueueTranslateToTensor(
376376
complete. If _event_wait_list_ and _event_ are not NULL, _event_
377377
must not refer to an element of the _event_wait_list_ array.
378378

379-
The *clEnqueueTranslateToTensor* function copies contents of the buffer
379+
The *clEnqueueExportToTensor* function copies contents of the buffer
380380
object / host allocation to tensor's storage in
381381
implementation-defined, opaque memory layout. The
382-
*clEnqueueTranslateFromTensor* function copies data from tensor's
382+
*clEnqueueImportFromTensor* function copies data from tensor's
383383
storage to buffer object / host allocation.
384384

385385
The elements of buffer object / host allocation are mapped to tensor
@@ -421,7 +421,7 @@ an abstract function that accesses a tensor element in its storage at
421421
given coordinate. The method how the coordinates translate to tensor
422422
storage addresses is unspecified.
423423

424-
*clEnqueueTranslateFsomTensor* and *clEnqueueTranslateToTensor*
424+
*clEnqueueImportFromTensor* and *clEnqueueExportToTensor*
425425
returns CL_SUCCESS if the function is executed
426426
successfully. Otherwise, it returns one of the following errors:
427427

@@ -469,13 +469,13 @@ successfully. Otherwise, it returns one of the following errors:
469469

470470
// TODO: add clEnqueueFillTensor?
471471

472-
If *cl_khr_command_buffer* is is supported, then the following command
473-
buffer counterparts of the *clEnqueueTranslateFromTensor* and
474-
*clEnqueueTranslateToTensor* commands are available.
472+
If *cl_khr_command_buffer* is supported, then the following command
473+
buffer counterparts of the *clEnqueueImportFromTensor* and
474+
*clEnqueueExportToTensor* commands are available.
475475

476476
[source,c]
477477
----
478-
cl_int clCommandTranslateFromTensorKHR(
478+
cl_int clCommandImportFromTensorKHR(
479479
cl_command_buffer_khr command_buffer,
480480
cl_command_queue command_queue,
481481
cl_tensor tensor,
@@ -493,7 +493,7 @@ cl_int clCommandTranslateFromTensorKHR(
493493

494494
[source,c]
495495
----
496-
cl_int clCommandTranslateToTensorKHR(
496+
cl_int clCommandExportToTensorKHR(
497497
cl_command_buffer_khr command_buffer,
498498
cl_command_queue command_queue,
499499
cl_tensor tensor,
@@ -513,13 +513,13 @@ cl_int clCommandTranslateToTensorKHR(
513513

514514
* For _command_queue_, _tensor_, _tensor_origin_, _mem_origin_,
515515
_region_, _mem_pitch_, _buffer_ and _host_ptr_ parameters refer to
516-
*clEnqueueTranslateFromTensor*.
516+
*clEnqueueImportFromTensor*.
517517

518518
* For _num_sync_points_in_wait_list_, _sync_point_wait_list_,
519519
_sync_point_, _mutable_handle_ parameters refer to
520520
*clCommandCopyBufferKHR*.
521521

522-
*clCommandTranslateFromTensorKHR* and *clCommandTranslateFromTensorKHR*
522+
*clCommandImportFromTensorKHR* and *clCommandImportFromTensorKHR*
523523
returns CL_SUCCESS if the function is executed
524524
successfully. Otherwise, it returns one of the following errors:
525525

@@ -701,17 +701,17 @@ std::vector<float> out_data(b * m * n);
701701
702702
// Copies data into in0 tensor while possibly rearranging the data to the
703703
// optimal data layout.
704-
clEnqueueTranslateToTensor(
704+
clEnqueueExportToTensor(
705705
cmd_q, in0, false, {0, 0, 0}, {0, 0, 0}, {b, m, k},
706706
nullptr, nullptr, in0_data.data(), 0, nullptr, nullptr);
707-
clEnqueueTranslateToTensor(
707+
clEnqueueExportToTensor(
708708
cmd_q, in1, false, {0, 0, 0}, {0, 0, 0}, {b, k, n},
709709
nullptr, nullptr, in1_data.data(), 0, nullptr, nullptr);
710710
clEnqueueNDRangeKernel(
711711
cmd_q, matmul_kernel, 3, matmul_grid, nullptr, nullptr, 0, nullptr, nullptr);
712712
clEnqueueNDRangeKernel(
713713
cmd_q, add_kernel, 3, add_grid, nullptr, nullptr, 0, nullptr, nullptr);
714-
clEnqueueTranslateFromTensor(
714+
clEnqueueImportFromTensor(
715715
cmd_q, out, false, {0, 0, 0}, {0, 0, 0}, {b, m, n},
716716
nullptr, nullptr, out_data.data(), 0, nullptr, nullptr);
717717
----
@@ -763,10 +763,10 @@ cl_command_buffer_khr cb =
763763
clCreateCommandBufferKHR(num_queues, queue_list, nullptr, &err);
764764
765765
cl_sync_point_khr in0_syncp, in1_syncp, matmul_syncp, add_syncp;
766-
clCommandTranslateToTensorKHR(
766+
clCommandExportToTensorKHR(
767767
cmd_b, cmd_q, in0, {0, 0, 0}, {0, 0, 0}, {b, m, k},
768768
nullptr, nullptr, in0_data.data(), 0, nullptr, &in0_syncp);
769-
clCommandTranslateToTensorKHR(
769+
clCommandExportToTensorKHR(
770770
cmd_b, cmd_q, in1, {0, 0, 0}, {0, 0, 0}, {b, k, m},
771771
nullptr, nullptr, in1_data.data(), 0, nullptr, &in1_syncp);
772772
clCommandNDRangeKernelKHR(
@@ -775,7 +775,7 @@ clCommandNDRangeKernelKHR(
775775
clCommandNDRangeKernelKHR(
776776
cmd_b, cmd_q, nullptr, add_kernel, 3, add_grid, nullptr, nullptr,
777777
1, {matmul_syncp}, &add_syncp, nullptr);
778-
clCommandTranslateFromTensorKHR(
778+
clCommandImportFromTensorKHR(
779779
cmd_b, cmd_q, out, {0, 0, 0}, {0, 0, 0}, {b, k, m},
780780
nullptr, nullptr, out_data.data(), 1, {add_syncp}, nullptr);
781781
@@ -789,7 +789,7 @@ clFinalizeCommandBufferKHR(cmd_b);
789789
// Temporary tensors used in a command buffer can't be read or written
790790
// into. A hypothetical reason is that the finalized command buffer
791791
// might not use some of the tensor.
792-
assert(clEnqueueTranslateFromTensor(..., t0, ...) == CL_INVALID_OPERATION);
792+
assert(clEnqueueImportFromTensor(..., t0, ...) == CL_INVALID_OPERATION);
793793
----
794794

795795
=== Open Questions ===

ext/cl_exp_tensor.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
939939
</div>
940940
<div class="listingblock">
941941
<div class="content">
942-
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clEnqueueTranslateFromTensor(
942+
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clEnqueueImportFromTensor(
943943
cl_command_queue command_queue,
944944
cl_tensor tensor,
945945
cl_bool blocking_command,
@@ -956,7 +956,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
956956
</div>
957957
<div class="listingblock">
958958
<div class="content">
959-
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clEnqueueTranslateToTensor(
959+
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clEnqueueExportToTensor(
960960
cl_command_queue command_queue,
961961
cl_tensor tensor,
962962
cl_bool blocking_command,
@@ -1040,10 +1040,10 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
10401040
</ul>
10411041
</div>
10421042
<div class="paragraph">
1043-
<p>The <strong>clEnqueueTranslateToTensor</strong> function copies contents of the buffer
1043+
<p>The <strong>clEnqueueExportToTensor</strong> function copies contents of the buffer
10441044
object / host allocation to tensor&#8217;s storage in
10451045
implementation-defined, opaque memory layout. The
1046-
<strong>clEnqueueTranslateFromTensor</strong> function copies data from tensor&#8217;s
1046+
<strong>clEnqueueImportFromTensor</strong> function copies data from tensor&#8217;s
10471047
storage to buffer object / host allocation.</p>
10481048
</div>
10491049
<div class="paragraph">
@@ -1089,7 +1089,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
10891089
storage addresses is unspecified.</p>
10901090
</div>
10911091
<div class="paragraph">
1092-
<p><strong>clEnqueueTranslateFsomTensor</strong> and <strong>clEnqueueTranslateToTensor</strong>
1092+
<p><strong>clEnqueueImportFromTensor</strong> and <strong>clEnqueueExportToTensor</strong>
10931093
returns CL_SUCCESS if the function is executed
10941094
successfully. Otherwise, it returns one of the following errors:</p>
10951095
</div>
@@ -1151,13 +1151,13 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
11511151
</ul>
11521152
</div>
11531153
<div class="paragraph">
1154-
<p>If <strong>cl_khr_command_buffer</strong> is is supported, then the following command
1155-
buffer counterparts of the <strong>clEnqueueTranslateFromTensor</strong> and
1156-
<strong>clEnqueueTranslateToTensor</strong> commands are available.</p>
1154+
<p>If <strong>cl_khr_command_buffer</strong> is supported, then the following command
1155+
buffer counterparts of the <strong>clEnqueueImportFromTensor</strong> and
1156+
<strong>clEnqueueExportToTensor</strong> commands are available.</p>
11571157
</div>
11581158
<div class="listingblock">
11591159
<div class="content">
1160-
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clCommandTranslateFromTensorKHR(
1160+
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clCommandImportFromTensorKHR(
11611161
cl_command_buffer_khr command_buffer,
11621162
cl_command_queue command_queue,
11631163
cl_tensor tensor,
@@ -1175,7 +1175,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
11751175
</div>
11761176
<div class="listingblock">
11771177
<div class="content">
1178-
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clCommandTranslateToTensorKHR(
1178+
<pre class="highlight"><code class="language-c" data-lang="c">cl_int clCommandExportToTensorKHR(
11791179
cl_command_buffer_khr command_buffer,
11801180
cl_command_queue command_queue,
11811181
cl_tensor tensor,
@@ -1199,7 +1199,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
11991199
<li>
12001200
<p>For <em>command_queue</em>, <em>tensor</em>, <em>tensor_origin</em>, <em>mem_origin</em>,
12011201
<em>region</em>, <em>mem_pitch</em>, <em>buffer</em> and <em>host_ptr</em> parameters refer to
1202-
<strong>clEnqueueTranslateFromTensor</strong>.</p>
1202+
<strong>clEnqueueImportFromTensor</strong>.</p>
12031203
</li>
12041204
<li>
12051205
<p>For <em>num_sync_points_in_wait_list</em>, <em>sync_point_wait_list</em>,
@@ -1209,7 +1209,7 @@ <h4 id="_new_opencl_functions_added_to_tensor_objects_section">New OpenCL Functi
12091209
</ul>
12101210
</div>
12111211
<div class="paragraph">
1212-
<p><strong>clCommandTranslateFromTensorKHR</strong> and <strong>clCommandTranslateFromTensorKHR</strong>
1212+
<p><strong>clCommandImportFromTensorKHR</strong> and <strong>clCommandImportFromTensorKHR</strong>
12131213
returns CL_SUCCESS if the function is executed
12141214
successfully. Otherwise, it returns one of the following errors:</p>
12151215
</div>
@@ -1458,17 +1458,17 @@ <h3 id="_sample_codes">Sample Codes</h3>
14581458

14591459
// Copies data into in0 tensor while possibly rearranging the data to the
14601460
// optimal data layout.
1461-
clEnqueueTranslateToTensor(
1461+
clEnqueueExportToTensor(
14621462
cmd_q, in0, false, {0, 0, 0}, {0, 0, 0}, {b, m, k},
14631463
nullptr, nullptr, in0_data.data(), 0, nullptr, nullptr);
1464-
clEnqueueTranslateToTensor(
1464+
clEnqueueExportToTensor(
14651465
cmd_q, in1, false, {0, 0, 0}, {0, 0, 0}, {b, k, n},
14661466
nullptr, nullptr, in1_data.data(), 0, nullptr, nullptr);
14671467
clEnqueueNDRangeKernel(
14681468
cmd_q, matmul_kernel, 3, matmul_grid, nullptr, nullptr, 0, nullptr, nullptr);
14691469
clEnqueueNDRangeKernel(
14701470
cmd_q, add_kernel, 3, add_grid, nullptr, nullptr, 0, nullptr, nullptr);
1471-
clEnqueueTranslateFromTensor(
1471+
clEnqueueImportFromTensor(
14721472
cmd_q, out, false, {0, 0, 0}, {0, 0, 0}, {b, m, n},
14731473
nullptr, nullptr, out_data.data(), 0, nullptr, nullptr);</code></pre>
14741474
</div>
@@ -1521,10 +1521,10 @@ <h3 id="_sample_codes">Sample Codes</h3>
15211521
clCreateCommandBufferKHR(num_queues, queue_list, nullptr, &amp;err);
15221522

15231523
cl_sync_point_khr in0_syncp, in1_syncp, matmul_syncp, add_syncp;
1524-
clCommandTranslateToTensorKHR(
1524+
clCommandExportToTensorKHR(
15251525
cmd_b, cmd_q, in0, {0, 0, 0}, {0, 0, 0}, {b, m, k},
15261526
nullptr, nullptr, in0_data.data(), 0, nullptr, &amp;in0_syncp);
1527-
clCommandTranslateToTensorKHR(
1527+
clCommandExportToTensorKHR(
15281528
cmd_b, cmd_q, in1, {0, 0, 0}, {0, 0, 0}, {b, k, m},
15291529
nullptr, nullptr, in1_data.data(), 0, nullptr, &amp;in1_syncp);
15301530
clCommandNDRangeKernelKHR(
@@ -1533,7 +1533,7 @@ <h3 id="_sample_codes">Sample Codes</h3>
15331533
clCommandNDRangeKernelKHR(
15341534
cmd_b, cmd_q, nullptr, add_kernel, 3, add_grid, nullptr, nullptr,
15351535
1, {matmul_syncp}, &amp;add_syncp, nullptr);
1536-
clCommandTranslateFromTensorKHR(
1536+
clCommandImportFromTensorKHR(
15371537
cmd_b, cmd_q, out, {0, 0, 0}, {0, 0, 0}, {b, k, m},
15381538
nullptr, nullptr, out_data.data(), 1, {add_syncp}, nullptr);
15391539

@@ -1547,7 +1547,7 @@ <h3 id="_sample_codes">Sample Codes</h3>
15471547
// Temporary tensors used in a command buffer can't be read or written
15481548
// into. A hypothetical reason is that the finalized command buffer
15491549
// might not use some of the tensor.
1550-
assert(clEnqueueTranslateFromTensor(..., t0, ...) == CL_INVALID_OPERATION);</code></pre>
1550+
assert(clEnqueueImportFromTensor(..., t0, ...) == CL_INVALID_OPERATION);</code></pre>
15511551
</div>
15521552
</div>
15531553
</div>
@@ -1592,7 +1592,7 @@ <h3 id="_open_questions">Open Questions</h3>
15921592
</div>
15931593
<div id="footer">
15941594
<div id="footer-text">
1595-
Last updated 2023-11-16 17:25:21 +0200
1595+
Last updated 2023-11-17 12:20:18 +0200
15961596
</div>
15971597
</div>
15981598
</body>

0 commit comments

Comments
 (0)