Skip to content

Commit 778fbb9

Browse files
authored
Merge pull request MicrosoftDocs#224 from logmanPL/patch-3
Fix: -remove * (was *//) from comment lines as it's not c++ single li…
2 parents 78eb5b6 + 38faa56 commit 778fbb9

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/parallel/amp/graphics-cpp-amp.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ texture<int_4, 2> aTexture(768, 1024, texels.begin(), texels.end());
121121
You can also declare and initialize a `texture` object by using a constructor overload that takes a pointer to the source data, the size of source data in bytes, and the bits per scalar element.
122122

123123
```cpp
124-
void createTextureWithBPC() { *// Create the source data.
124+
void createTextureWithBPC() { // Create the source data.
125125
float source[1024* 2];
126126
for (int i = 0; i <1024* 2; i++) {
127127
source[i] = (float)i;
128128
}
129-
*// Initialize the texture by using the size of source in bytes *// and bits per scalar element.
129+
// Initialize the texture by using the size of source in bytes // and bits per scalar element.
130130
texture<float_2, 1> floatTexture(1024, source, (unsigned int)sizeof(source), 32U);
131131

132132
}
@@ -164,10 +164,10 @@ void readTexture() {
164164

165165
const texture<int_2, 2> tex9(16, 32, src.begin(), src.end());
166166

167-
parallel_for_each(tex9.extent, [=, &tex9] (index<2> idx) restrict(amp) { *// Use the subscript operator.
168-
arr[idx].x += tex9[idx].x; *// Use the function () operator.
169-
arr[idx].x += tex9(idx).x; *// Use the get method.
170-
arr[idx].y += tex9.get(idx).y; *// Use the function () operator.
167+
parallel_for_each(tex9.extent, [=, &tex9] (index<2> idx) restrict(amp) { // Use the subscript operator.
168+
arr[idx].x += tex9[idx].x; // Use the function () operator.
169+
arr[idx].x += tex9(idx).x; // Use the get method.
170+
arr[idx].y += tex9.get(idx).y; // Use the function () operator.
171171
arr[idx].y += tex9(idx[0], idx[1]).y;
172172
});
173173

@@ -181,21 +181,21 @@ void readTexture() {
181181
The following code example demonstrates how to store texture channels in a short vector, and then access the individual scalar elements as properties of the short vector.
182182

183183
```cpp
184-
void UseBitsPerScalarElement() { *// Create the image data. *// Each unsigned int (32-bit) represents four 8-bit scalar elements(r,g,b,a values).
184+
void UseBitsPerScalarElement() { // Create the image data. // Each unsigned int (32-bit) represents four 8-bit scalar elements(r,g,b,a values).
185185
const int image_height = 16;
186186
const int image_width = 16;
187187
std::vector<unsigned int> image(image_height* image_width);
188188

189189

190190
extent<2> image_extent(image_height, image_width);
191191

192-
*// By using uint_4 and 8 bits per channel, each 8-bit channel in the data source is *// stored in one 32-bit component of a uint_4.
192+
// By using uint_4 and 8 bits per channel, each 8-bit channel in the data source is // stored in one 32-bit component of a uint_4.
193193
texture<uint_4, 2> image_texture(image_extent, image.data(), image_extent.size()* 4U, 8U);
194194

195-
*// Use can access the RGBA values of the source data by using swizzling expressions of the uint_4.
195+
// Use can access the RGBA values of the source data by using swizzling expressions of the uint_4.
196196
parallel_for_each(image_extent,
197197
[&image_texture](index<2> idx) restrict(amp)
198-
{ *// 4 bytes are automatically extracted when reading.
198+
{ // 4 bytes are automatically extracted when reading.
199199
uint_4 color = image_texture[idx];
200200
unsigned int r = color.r;
201201
unsigned int g = color.g;
@@ -250,7 +250,7 @@ void writeTexture() {
250250
You can copy between texture objects by using the [copy](reference/concurrency-namespace-functions-amp.md#copy) function or the [copy_async](reference/concurrency-namespace-functions-amp.md#copy_async) function, as shown in the following code example.
251251

252252
```cpp
253-
void copyHostArrayToTexture() { *// Copy from source array to texture object by using the copy function.
253+
void copyHostArrayToTexture() { // Copy from source array to texture object by using the copy function.
254254
float floatSource[1024* 2];
255255
for (int i = 0; i <1024* 2; i++) {
256256
floatSource[i] = (float)i;
@@ -259,15 +259,15 @@ void copyHostArrayToTexture() { *// Copy from source array to texture object by
259259

260260
copy(floatSource, (unsigned int)sizeof(floatSource), floatTexture);
261261

262-
*// Copy from source array to texture object by using the copy function.
262+
// Copy from source array to texture object by using the copy function.
263263
char charSource[16* 16];
264264
for (int i = 0; i <16* 16; i++) {
265265
charSource[i] = (char)i;
266266
}
267267
texture<int, 2> charTexture(16, 16, 8U);
268268

269269
copy(charSource, (unsigned int)sizeof(charSource), charTexture);
270-
*// Copy from texture object to source array by using the copy function.
270+
// Copy from texture object to source array by using the copy function.
271271
copy(charTexture, charSource, (unsigned int)sizeof(charSource));
272272

273273
}

0 commit comments

Comments
 (0)