<trclass="memdesc:gaefdc2847fb1d6c3fb1354e827a191ebd"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Blocks until the default device has completed all preceding requested tasks. <ahref="#gaefdc2847fb1d6c3fb1354e827a191ebd">More...</a><br/></td></tr>
<trclass="memdesc:ga8d57161ae56a8edc46eeda447417bf6c"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Destroy all resources and reset all state on the default device in the current process. <ahref="#ga8d57161ae56a8edc46eeda447417bf6c">More...</a><br/></td></tr>
<trclass="memdesc:ga8ec0b093af0adadc7fe98bf33fa21620"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set default device to be used for subsequent hip API calls from this thread. <ahref="#ga8ec0b093af0adadc7fe98bf33fa21620">More...</a><br/></td></tr>
<trclass="memdesc:gaffc83567f2df3bbe2d37a19872d60f24"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Return the default device id for the calling host thread. <ahref="#gaffc83567f2df3bbe2d37a19872d60f24">More...</a><br/></td></tr>
<trclass="memdesc:ga8555d5c76d88c50ddbf54ae70b568394"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Return number of compute-capable devices. <ahref="#ga8555d5c76d88c50ddbf54ae70b568394">More...</a><br/></td></tr>
<trclass="memitem:ga77c20744e2a88c31440992d6c7754b5f"><tdclass="memItemLeft"align="right"valign="top"><aclass="el"href="group__GlobalDefs.html#gadf5010f6e140a53ecbdf949e73e87594">hipError_t</a> </td><tdclass="memItemRight"valign="bottom"><aclass="el"href="group__Device.html#ga77c20744e2a88c31440992d6c7754b5f">hipGetDeviceProperties</a> (<aclass="el"href="structhipDeviceProp__t.html">hipDeviceProp_t</a> *prop, int device)</td></tr>
<trclass="memdesc:gaeeffa2456c5430400bea75ecd6ad1e68"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set Cache configuration for a specific function. <ahref="#gaeeffa2456c5430400bea75ecd6ad1e68">More...</a><br/></td></tr>
<trclass="memdesc:gadd94a910c2b840833cc325b1e5425702"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Set Cache configuration for a specific function. <ahref="#gadd94a910c2b840833cc325b1e5425702">More...</a><br/></td></tr>
<p>Destroy all resources and reset all state on the default device in the current process. </p>
<p>Explicity destroy all memory allocations, events, and queues associated with the default device in the current process.</p>
<p>This function will reset the device immmediately, and then return after all resources have been freed. The caller must ensure that the device is not being accessed by any other host threads from the active process when this function is called.</p>
<dlclass="section see"><dt>See Also</dt><dd><aclass="el"href="group__Device.html#gaefdc2847fb1d6c3fb1354e827a191ebd"title="Blocks until the default device has completed all preceding requested tasks. ">hipDeviceSynchronize</a></dd></dl>
<p>Blocks until the default device has completed all preceding requested tasks. </p>
<p>This function waits for all streams on the default device to complete execution, and then returns.</p>
<dlclass="section see"><dt>See Also</dt><dd><aclass="el"href="group__Device.html#ga8ec0b093af0adadc7fe98bf33fa21620"title="Set default device to be used for subsequent hip API calls from this thread. ">hipSetDevice</a>, <aclass="el"href="group__Device.html#ga8d57161ae56a8edc46eeda447417bf6c"title="Destroy all resources and reset all state on the default device in the current process. ">hipDeviceReset</a></dd></dl>
<p>Return the default device id for the calling host thread. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">device</td><td>*device is written with the default device</td></tr>
</table>
</dd>
</dl>
<p>HIP maintains an default device for each thread using thread-local-storage. This device is used implicitly for HIP runtime APIs called by this thread. hipGetDevice returns in * <code>device</code> the default device for the calling host thread.</p>
<dlclass="section see"><dt>See Also</dt><dd><aclass="el"href="group__Device.html#ga8ec0b093af0adadc7fe98bf33fa21620"title="Set default device to be used for subsequent hip API calls from this thread. ">hipSetDevice</a>, hipGetDevicesizeBytes</dd></dl>
<p>Returns in <code>*count</code> the number of devices that have ability to run compute commands. If there are no such devices, then <aclass="el"href="group__Device.html#ga8555d5c76d88c50ddbf54ae70b568394">hipGetDeviceCount</a> will return <aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594ad4406972c318df36d231310a15131c24"title="Call to hipGetDeviceCount returned 0 devices. ">hipErrorNoDevice</a>. If 1 or more devices can be found, then hipGetDeviceCount returns <aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594aadfbdb847b149723c684ebd764556063"title="Successful completion. ">hipSuccess</a>.</p>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594aadfbdb847b149723c684ebd764556063"title="Successful completion. ">hipSuccess</a>, <aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594ad4406972c318df36d231310a15131c24"title="Call to hipGetDeviceCount returned 0 devices. ">hipErrorNoDevice</a></dd></dl>
<tr><tdclass="paramdir">[out]</td><tdclass="paramname">prop</td><td>written with device properties </td></tr>
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">device</td><td>which device to query for information</td></tr>
</table>
</dd>
</dl>
<p>Populates hipGetDeviceProperties with information for the specified device.</p>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594aadfbdb847b149723c684ebd764556063"title="Successful completion. ">hipSuccess</a>, <aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594a07ab9b704ea693c1781a52741c60cd0d"title="DeviceID must be in range 0...#compute-devices. ">hipErrorInvalidDevice</a></dd></dl>
<p>Set default device to be used for subsequent hip API calls from this thread. </p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramdir">[in]</td><tdclass="paramname">device</td><td>Valid device in range 0...<aclass="el"href="group__Device.html#ga8555d5c76d88c50ddbf54ae70b568394"title="Return number of compute-capable devices. ">hipGetDeviceCount()</a>.</td></tr>
</table>
</dd>
</dl>
<p>Sets <code>device</code> as the default device for the calling host thread. Valid device id's are 0... (<aclass="el"href="group__Device.html#ga8555d5c76d88c50ddbf54ae70b568394"title="Return number of compute-capable devices. ">hipGetDeviceCount()</a>-1).</p>
<p>Many HIP APIs implicitly use the "default device" :</p>
<ul>
<li>Any device memory subsequently allocated from this host thread (using hipMalloc) will be allocated on device.</li>
<li>Any streams or events created from this host thread will be associated with device.</li>
<li>Any kernels launched from this host thread (using hipLaunchKernel) will be executed on device (unless a specific stream is specified, in which case the device associated with that stream will be used).</li>
</ul>
<p>This function may be called from any host thread. Multiple host threads may use the same device. This function does no synchronization with the previous or new device, and has very little runtime overhead. Applications can use hipSetDevice to quickly switch the default device before making a HIP runtime call which uses the default device.</p>
<p>The default device is stored in thread-local-storage for each thread. Thread-pool implementations may inherit the default device of the previous thread. A good practice is to always call hipSetDevice at the start of HIP coding sequency to establish a known standard device.</p>
<dlclass="section see"><dt>See Also</dt><dd><aclass="el"href="group__Device.html#gaffc83567f2df3bbe2d37a19872d60f24"title="Return the default device id for the calling host thread. ">hipGetDevice</a>, <aclass="el"href="group__Device.html#ga8555d5c76d88c50ddbf54ae70b568394"title="Return number of compute-capable devices. ">hipGetDeviceCount</a></dd></dl>
<dlclass="section return"><dt>Returns</dt><dd><aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594aadfbdb847b149723c684ebd764556063"title="Successful completion. ">hipSuccess</a>, <aclass="el"href="group__GlobalDefs.html#ggadf5010f6e140a53ecbdf949e73e87594a07ab9b704ea693c1781a52741c60cd0d"title="DeviceID must be in range 0...#compute-devices. ">hipErrorInvalidDevice</a></dd></dl>