• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2021 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #ifndef TENSORFLOW_CORE_PROFILER_INTERNAL_GPU_CUDA_TEST_H_
17 #define TENSORFLOW_CORE_PROFILER_INTERNAL_GPU_CUDA_TEST_H_
18 
19 namespace tensorflow {
20 namespace profiler {
21 namespace test {
22 // Calls a function on the device to print a string as many times as indicated
23 // by iters.
24 void PrintfKernel(int iters = 1);
25 
26 // Calls an empty kernel (named "empty") on the device as many times as
27 // indicated by iters.
28 void EmptyKernel(int iters = 1);
29 
30 // Waits for device activity to complete.
31 void Synchronize();
32 
33 // Copies a few bytes of memory from host to device.
34 void MemCopyH2D();
35 
36 // Copies a few bytes of memory from device to host, asynchronously.
37 void MemCopyH2D_Async();
38 
39 // Copies a few bytes of memory from device to host.
40 void MemCopyD2H();
41 
42 // Returns true if it s possible to copy bytes from device 0 to device 1.
43 bool MemCopyP2PAvailable();
44 
45 // Copies a few bytes of memory from device 0 to device 1.
46 void MemCopyP2PImplicit();
47 
48 // Copies a few bytes of memory from device 0 to device 1.
49 void MemCopyP2PExplicit();
50 
51 }  // namespace test
52 }  // namespace profiler
53 }  // namespace tensorflow
54 
55 #endif  // TENSORFLOW_CORE_PROFILER_INTERNAL_GPU_CUDA_TEST_H_
56