Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Deploy Documentation: Fix syntax error in example in documentation. (#…
Browse files Browse the repository at this point in the history
…1841)

* Fix example in documentation

---------

Co-authored-by: Michael Schellenberger Costa <miscco@nvidia.com> 3b3ed80
  • Loading branch information
miscco committed Feb 21, 2023
1 parent ed02b51 commit 5f6e257
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
5 changes: 2 additions & 3 deletions api/groups/group__execution__policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,9 @@ struct printf_functor
}
};
...
int vec(3);
vec[0] = 0; vec[1] = 1; vec[2] = 2;
int vec[] = { 0, 1, 2 };

thrust::for_each(thrust::host, vec.begin(), vec.end(), printf_functor());
thrust::for_each(thrust::host, vec, vec + 3, printf_functor());

// 0 1 2 is printed to standard output in some unspecified order
```
Expand Down
10 changes: 5 additions & 5 deletions api/groups/group__execution__policies.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"category": "attributes",
"const": false,
"definition": "const detail::host_t thrust::host",
"details": "<code>thrust::host</code> is the default parallel execution policy associated with Thrust's host backend system configured by the <code>THRUST&#95;HOST&#95;SYSTEM</code> macro.\n\nInstead of relying on implicit algorithm dispatch through iterator system tags, users may directly target algorithm dispatch at Thrust's host system by providing <code>thrust::host</code> as an algorithm parameter.\n\nExplicit dispatch can be useful in avoiding the introduction of data copies into containers such as <code><a href=\"{{ site.baseurl }}/api/classes/classthrust_1_1host__vector.html\">thrust::host&#95;vector</a></code>.\n\nNote that even though <code>thrust::host</code> targets the host CPU, it is a parallel execution policy. That is, the order that an algorithm invokes functors or dereferences iterators is not defined.\n\nThe type of <code>thrust::host</code> is implementation-defined.\n\nThe following code snippet demonstrates how to use <code>thrust::host</code> to explicitly dispatch an invocation of <code>thrust::for&#95;each</code> to the host backend system:\n\n\n\n```cpp\n#include <thrust/for_each.h>\n#include <thrust/execution_policy.h>\n#include <cstdio>\n\nstruct printf_functor\n{\n __host__ __device__\n void operator()(int x)\n {\n printf(\"%d\\n\", x);\n }\n};\n...\nint vec(3);\nvec[0] = 0; vec[1] = 1; vec[2] = 2;\n\nthrust::for_each(thrust::host, vec.begin(), vec.end(), printf_functor());\n\n// 0 1 2 is printed to standard output in some unspecified order\n```",
"details": "<code>thrust::host</code> is the default parallel execution policy associated with Thrust's host backend system configured by the <code>THRUST&#95;HOST&#95;SYSTEM</code> macro.\n\nInstead of relying on implicit algorithm dispatch through iterator system tags, users may directly target algorithm dispatch at Thrust's host system by providing <code>thrust::host</code> as an algorithm parameter.\n\nExplicit dispatch can be useful in avoiding the introduction of data copies into containers such as <code><a href=\"{{ site.baseurl }}/api/classes/classthrust_1_1host__vector.html\">thrust::host&#95;vector</a></code>.\n\nNote that even though <code>thrust::host</code> targets the host CPU, it is a parallel execution policy. That is, the order that an algorithm invokes functors or dereferences iterators is not defined.\n\nThe type of <code>thrust::host</code> is implementation-defined.\n\nThe following code snippet demonstrates how to use <code>thrust::host</code> to explicitly dispatch an invocation of <code>thrust::for&#95;each</code> to the host backend system:\n\n\n\n```cpp\n#include <thrust/for_each.h>\n#include <thrust/execution_policy.h>\n#include <cstdio>\n\nstruct printf_functor\n{\n __host__ __device__\n void operator()(int x)\n {\n printf(\"%d\\n\", x);\n }\n};\n...\nint vec[] = { 0, 1, 2 };\n\nthrust::for_each(thrust::host, vec, vec + 3, printf_functor());\n\n// 0 1 2 is printed to standard output in some unspecified order\n```",
"explicit": false,
"fullname": "execution_policies::host",
"hasDetails": true,
Expand All @@ -30,10 +30,10 @@
"language": "",
"location": {
"bodyFile": "thrust/execution_policy.h",
"bodyStart": 296,
"bodyStart": 295,
"column": 29,
"file": "thrust/execution_policy.h",
"line": 296
"line": 295
},
"name": "host",
"override": false,
Expand Down Expand Up @@ -66,10 +66,10 @@
"language": "",
"location": {
"bodyFile": "thrust/execution_policy.h",
"bodyStart": 345,
"bodyStart": 344,
"column": 41,
"file": "thrust/execution_policy.h",
"line": 345
"line": 344
},
"name": "device",
"override": false,
Expand Down
5 changes: 2 additions & 3 deletions api/namespaces/namespacethrust.md
Original file line number Diff line number Diff line change
Expand Up @@ -5326,10 +5326,9 @@ struct printf_functor
}
};
...
int vec(3);
vec[0] = 0; vec[1] = 1; vec[2] = 2;
int vec[] = { 0, 1, 2 };

thrust::for_each(thrust::host, vec.begin(), vec.end(), printf_functor());
thrust::for_each(thrust::host, vec, vec + 3, printf_functor());

// 0 1 2 is printed to standard output in some unspecified order
```
Expand Down
10 changes: 5 additions & 5 deletions api/namespaces/namespacethrust.md.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"category": "attributes",
"const": false,
"definition": "const detail::host_t thrust::host",
"details": "<code>thrust::host</code> is the default parallel execution policy associated with Thrust's host backend system configured by the <code>THRUST&#95;HOST&#95;SYSTEM</code> macro.\n\nInstead of relying on implicit algorithm dispatch through iterator system tags, users may directly target algorithm dispatch at Thrust's host system by providing <code>thrust::host</code> as an algorithm parameter.\n\nExplicit dispatch can be useful in avoiding the introduction of data copies into containers such as <code><a href=\"{{ site.baseurl }}/api/classes/classthrust_1_1host__vector.html\">thrust::host&#95;vector</a></code>.\n\nNote that even though <code>thrust::host</code> targets the host CPU, it is a parallel execution policy. That is, the order that an algorithm invokes functors or dereferences iterators is not defined.\n\nThe type of <code>thrust::host</code> is implementation-defined.\n\nThe following code snippet demonstrates how to use <code>thrust::host</code> to explicitly dispatch an invocation of <code>thrust::for&#95;each</code> to the host backend system:\n\n\n\n```cpp\n#include <thrust/for_each.h>\n#include <thrust/execution_policy.h>\n#include <cstdio>\n\nstruct printf_functor\n{\n __host__ __device__\n void operator()(int x)\n {\n printf(\"%d\\n\", x);\n }\n};\n...\nint vec(3);\nvec[0] = 0; vec[1] = 1; vec[2] = 2;\n\nthrust::for_each(thrust::host, vec.begin(), vec.end(), printf_functor());\n\n// 0 1 2 is printed to standard output in some unspecified order\n```",
"details": "<code>thrust::host</code> is the default parallel execution policy associated with Thrust's host backend system configured by the <code>THRUST&#95;HOST&#95;SYSTEM</code> macro.\n\nInstead of relying on implicit algorithm dispatch through iterator system tags, users may directly target algorithm dispatch at Thrust's host system by providing <code>thrust::host</code> as an algorithm parameter.\n\nExplicit dispatch can be useful in avoiding the introduction of data copies into containers such as <code><a href=\"{{ site.baseurl }}/api/classes/classthrust_1_1host__vector.html\">thrust::host&#95;vector</a></code>.\n\nNote that even though <code>thrust::host</code> targets the host CPU, it is a parallel execution policy. That is, the order that an algorithm invokes functors or dereferences iterators is not defined.\n\nThe type of <code>thrust::host</code> is implementation-defined.\n\nThe following code snippet demonstrates how to use <code>thrust::host</code> to explicitly dispatch an invocation of <code>thrust::for&#95;each</code> to the host backend system:\n\n\n\n```cpp\n#include <thrust/for_each.h>\n#include <thrust/execution_policy.h>\n#include <cstdio>\n\nstruct printf_functor\n{\n __host__ __device__\n void operator()(int x)\n {\n printf(\"%d\\n\", x);\n }\n};\n...\nint vec[] = { 0, 1, 2 };\n\nthrust::for_each(thrust::host, vec, vec + 3, printf_functor());\n\n// 0 1 2 is printed to standard output in some unspecified order\n```",
"explicit": false,
"fullname": "thrust::host",
"hasDetails": true,
Expand All @@ -250,10 +250,10 @@
"language": "cpp",
"location": {
"bodyFile": "thrust/execution_policy.h",
"bodyStart": 296,
"bodyStart": 295,
"column": 29,
"file": "thrust/execution_policy.h",
"line": 296
"line": 295
},
"name": "host",
"override": false,
Expand Down Expand Up @@ -286,10 +286,10 @@
"language": "cpp",
"location": {
"bodyFile": "thrust/execution_policy.h",
"bodyStart": 345,
"bodyStart": 344,
"column": 41,
"file": "thrust/execution_policy.h",
"line": 345
"line": 344
},
"name": "device",
"override": false,
Expand Down

0 comments on commit 5f6e257

Please sign in to comment.