You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/parallel/amp/cpp-amp-cpp-accelerated-massive-parallelism.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ C++ AMP (C++ Accelerated Massive Parallelism) accelerates the execution of your
41
41
|Title|Description|
42
42
|-----------|-----------------|
43
43
|[C++ AMP Overview](../../parallel/amp/cpp-amp-overview.md)|Describes the key features of C++ AMP and the mathematical library.|
44
-
|[Using Lambdas, Function Objects, and Restricted Functions](../../parallel/amp/using-lambdas-function-objects-and-restricted-functions.md)|Describes how to use lambda expressions, function objects, and restricted functions in calls to the [parallel_for_each](../Topic/parallel_for_each%20Function%20\(C++%20AMP\).md) method.|
44
+
|[Using Lambdas, Function Objects, and Restricted Functions](../../parallel/amp/using-lambdas-function-objects-and-restricted-functions.md)|Describes how to use lambda expressions, function objects, and restricted functions in calls to the [parallel_for_each](reference/concurrency-namespace-functions-amp.md#parallel_for_each) method.|
45
45
|[Using Tiles](../../parallel/amp/using-tiles.md)|Describes how to use tiles to accelerate your C++ AMP code.|
46
46
|[Using accelerator and accelerator_view Objects](../../parallel/amp/using-accelerator-and-accelerator-view-objects.md)|Describes how to use accelerators to customize execution of your code on the GPU.|
47
47
|[Using C++ AMP in Windows Store Apps](../../parallel/amp/using-cpp-amp-in-windows-store-apps.md)|Describes how to use C++ AMP in [!INCLUDE[win8_appname_long](../../build/includes/win8_appname_long_md.md)] apps that use Windows Runtime types.|
You can read from a `texture` object by using [texture::operatorOperator](../Topic/texture::operatorOperator.md), [texture::operator() Operator](../Topic/texture::operator\(\)%20Operator.md), or [texture::get Method](../Topic/texture::get%20Method.md). [texture::operatorOperator](../Topic/texture::operatorOperator.md) and [texture::operator() Operator](../Topic/texture::operator\(\)%20Operator.md) return a value, not a reference. Therefore, you cannot write to a `texture` object by using [texture::operatorOperator](../Topic/texture::operatorOperator.md).
165
+
You can read from a `texture` object by using [texture::operator\[\]](reference/texture-class.md#texture__operator_at), [texture::operator() Operator](reference/texture-class.md#texture__operator_call), or [texture::get Method](reference/texture-class.md#texture__get). [texture::operatorOperator](reference/texture-class.md#texture__operator.md) and [texture::operator() Operator](reference/texture-class.md#texture__operator\(\)%20Operator.md) return a value, not a reference. Therefore, you cannot write to a `texture` object by using `texture::operator\[\]`.
166
166
167
167
```cpp
168
168
@@ -240,7 +240,7 @@ void UseBitsPerScalarElement() { *// Create the image data. *// Each unsigned in
Use the [texture::set](../Topic/texture::set%20Method.md) method to write to `texture` objects. A texture object can be readonly or read/write. For a texture object to be readable and writeable, the following conditions must be true:
243
+
Use the [texture::set](reference/texture-class.md#texture__set) method to write to `texture` objects. A texture object can be readonly or read/write. For a texture object to be readable and writeable, the following conditions must be true:
244
244
245
245
- T has only one scalar component. (Short vectors are not allowed.)
246
246
@@ -268,7 +268,7 @@ void writeTexture() {
268
268
```
269
269
270
270
### Copying Texture Objects
271
-
You can copy between texture objects by using the [copy](../Topic/copy%20Function.md) function or the [copy_async](../Topic/copy_async%20Function.md) function, as shown in the following code example.
271
+
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.
272
272
273
273
```cpp
274
274
@@ -296,7 +296,7 @@ void copyHostArrayToTexture() { *// Copy from source array to texture object by
296
296
297
297
```
298
298
299
-
You can also copy from one texture to another by using the [texture::copy_to](../Topic/texture::copy_to%20Method.md) method. The two textures can be on different accelerator_views. When you copy to a `writeonly_texture_view` object, the data is copied to the underlying `texture` object. The bits per scalar element and the extent must be the same on the source and destination `texture` objects. If those requirements are not met, the runtime throws an exception.
299
+
You can also copy from one texture to another by using the [texture::copy_to](reference/texture-class.md#texture__copy_to) method. The two textures can be on different accelerator_views. When you copy to a `writeonly_texture_view` object, the data is copied to the underlying `texture` object. The bits per scalar element and the extent must be the same on the source and destination `texture` objects. If those requirements are not met, the runtime throws an exception.
300
300
301
301
## Texture View Classes
302
302
C++ AMP introduces the [texture_view Class](../../parallel/amp/reference/texture-view-class.md) in [!INCLUDE[vs_dev12](../../atl-mfc-shared/includes/vs_dev12_md.md)]. Texture views support the same texel types and ranks as the [texture Class](../../parallel/amp/reference/texture-class.md), but unlike textures, they provide access to additional hardware features such as texture sampling and mipmaps. Texture views support read-only, write-only, and read-write access to the underlying texture data.
Texture views whose elements are based on floating-point types—for example, float, float_2, or float_4—can also be read by using texture sampling to take advantage of hardware support for various filtering modes and addressing modes. C++ AMP supports the two filtering modes that are most common in compute scenarios—point-filtering (nearest-neighbor) and linear-filtering (weighted average)—and four addressing modes—wrapped, mirrored, clamped, and border. For more information about filtering modes, see [filter_mode Enumeration](../Topic/filter_mode%20Enumeration.md); for more information about addressing modes, see [address_mode Enumeration](../Topic/address_mode%20Enumeration.md).
421
+
Texture views whose elements are based on floating-point types—for example, float, float_2, or float_4—can also be read by using texture sampling to take advantage of hardware support for various filtering modes and addressing modes. C++ AMP supports the two filtering modes that are most common in compute scenarios—point-filtering (nearest-neighbor) and linear-filtering (weighted average)—and four addressing modes—wrapped, mirrored, clamped, and border. For more information about filtering modes, see [filter_mode Enumeration](reference/concurrency-namespace-enums-amp.md#filter_mode); for more information about addressing modes, see [address_mode Enumeration](reference/concurrency-namespace-enums-amp.md#address_mode).
422
422
423
423
In addition to modes that C++ AMP supports directly, you can access other filtering modes and addressing modes of the underlying platform by using the interop APIs to adopt a texture sampler that was created by using the platform APIs directly. For example, Direct3D supports other filtering modes such as anisotropic filtering, and can apply a different addressing mode to each dimension of a texture. You could create a texture sampler whose coordinates are wrapped vertically, mirrored horizontally, and sampled with anisotropic filtering by using the Direct3D APIs, and then leverage the sampler in your C++ AMP code by using the `make_sampler` interop API. For more information see [Texture Sampling in C++ AMP](http://blogs.msdn.com/b/nativeconcurrency/archive/2013/07/18/texture-sampling-in-c-amp.aspx) on the Parallel Programming in Native Code blog.
424
424
425
425
Texture views also support the reading of mipmaps. Read-only texture views (those that have a const element type) offer the most flexibility because a range of mip-levels that is determined at instantiation can be dynamically sampled, and because elements that have 1, 2, or 4 components are supported. Read-write texture views that have elements that have one component also support mipmaps, but only of a level that's determined at instantiation. For more information, see [Texture with Mipmaps](http://blogs.msdn.com/b/nativeconcurrency/archive/2013/08/22/texture-with-mipmaps.aspx) on the Parallel Programming in Native Code blog.
426
426
427
427
### Writing to Texture View Objects
428
-
Use the [texture_view::get Method](../Topic/texture_view::get%20Method.md) to write to the underlying `texture` through the `texture_view` object. A texture view can be read-only, read-write, or write-only. For a texture view to be writable it must have an element type that is non-const; for a texture view to be readable and writable, its element type must also have only one component. Otherwise, the texture view is read-only. You can only access one mipmap level of a texture at a time through a texture view, and the level is specified when the view is instantiated.
428
+
Use the [texture_view::get Method](reference/texture_view-class.md#texture_view__get) to write to the underlying `texture` through the `texture_view` object. A texture view can be read-only, read-write, or write-only. For a texture view to be writable it must have an element type that is non-const; for a texture view to be readable and writable, its element type must also have only one component. Otherwise, the texture view is read-only. You can only access one mipmap level of a texture at a time through a texture view, and the level is specified when the view is instantiated.
429
429
430
430
This example shows how to write to the second-most detailed mipmap level of a texture that has 4 mipmap levels. The most detailed mipmap level is level 0.
The C++ AMP runtime supports interoperability between `texture<T,1>` and the [ID3D11Texture1D interface](http://go.microsoft.com/fwlink/p/LinkId=248503), between `texture<T,2>` and the [ID3D11Texture2D interface](http://go.microsoft.com/fwlink/p/LinkId=255317), and between `texture<T,3>` and the [ID3D11Texture3D interface](http://go.microsoft.com/fwlink/p/LinkId=255377). The [get_texture](../Topic/get_texture%20Function.md) method takes a `texture` object and returns an `IUnknown` interface. The [make_texture](../Topic/make_texture%20Function.md) method takes an `IUnknown` interface and an `accelerator_view` object and returns a `texture` object.
449
+
The C++ AMP runtime supports interoperability between `texture<T,1>` and the [ID3D11Texture1D interface](http://go.microsoft.com/fwlink/p/LinkId=248503), between `texture<T,2>` and the [ID3D11Texture2D interface](http://go.microsoft.com/fwlink/p/LinkId=255317), and between `texture<T,3>` and the [ID3D11Texture3D interface](http://go.microsoft.com/fwlink/p/LinkId=255377). The [get_texture](reference/concurrency-namespace-functions-amp.md#get_texture) method takes a `texture` object and returns an `IUnknown` interface. The [make_texture](reference/concurrency-namespace-functions-amp.md#make_texture) method takes an `IUnknown` interface and an `accelerator_view` object and returns a `texture` object.
Copy file name to clipboardExpand all lines: docs/parallel/amp/reference/texture-class.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,9 @@ class texture;
84
84
85
85
|Name|Description|
86
86
|----------|-----------------|
87
-
|[texture::operator() Operator](#texture__operator___operator)|Returns the element value that is specified by the parameters.|
88
-
|[texture::operator[] Operator](#texture__operator_at_operator)|Returns the element that is at the specified index.|
89
-
|[texture::operator= Operator](#texture__operator_eq_operator)|Copies the specified [texture](../../../parallel/amp/reference/texture-class.md) object to this one.|
87
+
|[texture::operator() Operator](#texture__operator_call)|Returns the element value that is specified by the parameters.|
88
+
|[texture::operator[] Operator](#texture__operator_at)|Returns the element that is at the specified index.|
89
+
|[texture::operator= Operator](#texture__operator_eq)|Copies the specified [texture](../../../parallel/amp/reference/texture-class.md) object to this one.|
90
90
91
91
### Public Constants
92
92
@@ -215,7 +215,7 @@ unsigned int get_row_pitch() const restrict(cpu);
215
215
### Return Value
216
216
The number of bytes between each row in a 2-dimensional staging texture, or between each row of a depth slice in 3-dimensional staging texture.
0 commit comments