Skip to content

Commit 59d4006

Browse files
committed
Formatted using black.
1 parent 15f1881 commit 59d4006

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

kernel_tuner/backends/backend.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,81 +6,84 @@
66

77
class Backend(ABC):
88
"""Base class for kernel_tuner backends"""
9+
910
@abstractmethod
1011
def ready_argument_list(self, arguments):
11-
""" This method must implement the allocation of the arguments on device memory. """
12+
"""This method must implement the allocation of the arguments on device memory."""
1213
pass
1314

1415
@abstractmethod
1516
def compile(self, kernel_instance):
16-
""" This method must implement the compilation of a kernel into a callable function. """
17+
"""This method must implement the compilation of a kernel into a callable function."""
1718
pass
1819

1920
@abstractmethod
2021
def start_event(self):
21-
""" This method must implement the recording of the start of a measurement. """
22+
"""This method must implement the recording of the start of a measurement."""
2223
pass
2324

2425
@abstractmethod
2526
def stop_event(self):
26-
""" This method must implement the recording of the end of a measurement. """
27+
"""This method must implement the recording of the end of a measurement."""
2728
pass
2829

2930
@abstractmethod
3031
def kernel_finished(self):
31-
""" This method must implement a check that returns True if the kernel has finished, False otherwise. """
32+
"""This method must implement a check that returns True if the kernel has finished, False otherwise."""
3233
pass
3334

3435
@abstractmethod
3536
def synchronize(self):
36-
""" This method must implement a barrier that halts execution until device has finished its tasks. """
37+
"""This method must implement a barrier that halts execution until device has finished its tasks."""
3738
pass
3839

3940
@abstractmethod
4041
def run_kernel(self, func, gpu_args, threads, grid, stream):
41-
""" This method must implement the execution of the kernel on the device. """
42+
"""This method must implement the execution of the kernel on the device."""
4243
pass
4344

4445
@abstractmethod
4546
def memset(self, allocation, value, size):
46-
""" This method must implement setting the memory to a value on the device. """
47+
"""This method must implement setting the memory to a value on the device."""
4748
pass
4849

4950
@abstractmethod
5051
def memcpy_dtoh(self, dest, src):
51-
""" This method must implement a device to host copy. """
52+
"""This method must implement a device to host copy."""
5253
pass
5354

5455
@abstractmethod
5556
def memcpy_htod(self, dest, src):
56-
""" This method must implement a host to device copy. """
57+
"""This method must implement a host to device copy."""
5758
pass
5859

5960

6061
class GPUBackend(Backend):
6162
"""Base class for GPU backends"""
63+
6264
@abstractmethod
6365
def __init__(self, device, iterations, compiler_options, observers):
6466
pass
6567

6668
@abstractmethod
6769
def copy_constant_memory_args(self, cmem_args):
68-
""" This method must implement the allocation and copy of constant memory to the GPU. """
70+
"""This method must implement the allocation and copy of constant memory to the GPU."""
6971
pass
7072

7173
@abstractmethod
7274
def copy_shared_memory_args(self, smem_args):
73-
""" This method must implement the dynamic allocation of shared memory on the GPU. """
75+
"""This method must implement the dynamic allocation of shared memory on the GPU."""
7476
pass
7577

7678
@abstractmethod
7779
def copy_texture_memory_args(self, texmem_args):
78-
""" This method must implement the allocation and copy of texture memory to the GPU. """
80+
"""This method must implement the allocation and copy of texture memory to the GPU."""
7981
pass
8082

8183

8284
class CompilerBackend(Backend):
8385
"""Base class for compiler backends"""
86+
8487
@abstractmethod
8588
def __init__(self, iterations, compiler_options, compiler):
8689
pass

0 commit comments

Comments
 (0)