~ubuntu-branches/ubuntu/utopic/libthrust/utopic

« back to all changes in this revision

Viewing changes to system/cuda/detail/runtime_introspection.h

  • Committer: Package Import Robot
  • Author(s): Andreas Beckmann
  • Date: 2013-07-10 12:57:33 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20130710125733-my19jic71sqsabaj
Tags: 1.7.0-1
* New upstream release.  (Closes: #715362)
* Update watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright 2008-2012 NVIDIA Corporation
 
3
 *
 
4
 *  Licensed under the Apache License, Version 2.0 (the "License");
 
5
 *  you may not use this file except in compliance with the License.
 
6
 *  You may obtain a copy of the License at
 
7
 *
 
8
 *      http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 *  Unless required by applicable law or agreed to in writing, software
 
11
 *  distributed under the License is distributed on an "AS IS" BASIS,
 
12
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
13
 *  See the License for the specific language governing permissions and
 
14
 *  limitations under the License.
 
15
 */
 
16
 
 
17
 
 
18
/*! \file runtime_introspection.h
 
19
 *  \brief Defines the interface to functions
 
20
 *         providing introspection into the architecture
 
21
 *         of CUDA devices.
 
22
 */
 
23
 
 
24
#pragma once
 
25
 
 
26
#include <thrust/detail/config.h>
 
27
 
 
28
// #include this for device_properties_t and function_attributes_t
 
29
#include <thrust/system/cuda/detail/cuda_launch_config.h>
 
30
 
 
31
// #include this for size_t
 
32
#include <cstddef>
 
33
 
 
34
namespace thrust
 
35
{
 
36
namespace system
 
37
{
 
38
namespace cuda
 
39
{
 
40
namespace detail
 
41
{
 
42
 
 
43
 
 
44
/*! Returns the current device ordinal.
 
45
 */
 
46
inline int current_device();
 
47
 
 
48
/*! Returns a copy of the device_properties_t structure
 
49
 *  that is associated with a given device.
 
50
 */
 
51
inline device_properties_t device_properties(int device_id);
 
52
 
 
53
/*! Returns a copy of the device_properties_t structure
 
54
 *  that is associated with the current device.
 
55
 */
 
56
inline device_properties_t device_properties(void);
 
57
 
 
58
/*! Returns a copy of the function_attributes_t structure
 
59
 *  that is associated with a given __global__ function
 
60
 */
 
61
template <typename KernelFunction>
 
62
inline function_attributes_t function_attributes(KernelFunction kernel);
 
63
 
 
64
/*! Returns the compute capability of a device in integer format.
 
65
 *  For example, returns 10 for sm_10 and 21 for sm_21
 
66
 *  \return The compute capability as an integer
 
67
 */
 
68
inline size_t compute_capability(const device_properties_t &properties);
 
69
inline size_t compute_capability(void);
 
70
 
 
71
 
 
72
} // end namespace detail
 
73
} // end namespace cuda
 
74
} // end namespace system
 
75
} // end namespace thrust
 
76
 
 
77
#include <thrust/system/cuda/detail/runtime_introspection.inl>
 
78