Tools

Tests for reprospect.tools.

The tests for the three main subpackages can be found in:

Architecture

class tests.tools.test_architecture.TestComputeCapabilityView on GitHub

Bases: object

Tests for reprospect.tools.architecture.ComputeCapability.

test_from_int() NoneView on GitHub
test_lt() NoneView on GitHub
test_supported() NoneView on GitHub

Test reprospect.tools.architecture.ComputeCapability.supported().

class tests.tools.test_architecture.TestNVIDIAArchView on GitHub

Bases: object

Tests for reprospect.tools.architecture.NVIDIAArch.

test_as_compute() NoneView on GitHub
test_as_sm() NoneView on GitHub
test_cc_cycle(parameters: Parameters) NoneView on GitHub
test_from_compute_capability() NoneView on GitHub
test_from_str() NoneView on GitHub
test_in_cuda_support(parameters: Parameters) NoneView on GitHub
test_repr() NoneView on GitHub
test_str() NoneView on GitHub
test_str_cycle(parameters: Parameters) NoneView on GitHub
class tests.tools.test_architecture.TestNVIDIAFamilyView on GitHub

Bases: object

Tests for reprospect.tools.architecture.NVIDIAFamily.

test_from_compute_capability() NoneView on GitHub
test_from_string() NoneView on GitHub
test_to_string() NoneView on GitHub

Cacher

class tests.tools.test_cacher.DummyImplementation(directory: str | Path)View on GitHub

Bases: Cacher

TABLE: ClassVar[str] = 'dummy'

Name of the table.

populate(directory: Path, **kwargs) AnyView on GitHub
class tests.tools.test_cacher.TestCacherView on GitHub

Bases: object

Tests for reprospect.tools.cacher.Cacher.

test_cache_hit() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.get() for the second time leads to a cache hit.

test_cache_miss() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.get() for the first time leads to a cache miss.

test_hash_different() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.hash() twice with different values returns different hashes.

test_hash_same() NoneView on GitHub

Check that calling reprospect.tools.cacher.Cacher.hash() twice with the same values returns the same hash.

Compile command

class tests.tools.test_compile_command.TestGetArchFromCompileCommandView on GitHub

Bases: object

Tests for reprospect.tools.compile_command.get_arch_from_compile_command().

test_from_bits() NoneView on GitHub
test_from_compile_commands_json(cmake_file_api) NoneView on GitHub
tests.tools.test_compile_command.cmake_file_api() FileAPIView on GitHub

Device properties

class tests.tools.test_device_properties.TestCuda(methodName='runTest')View on GitHub

Bases: TestCase

Test for reprospect.tools.device_properties.Cuda.

test_check_driver_status() NoneView on GitHub

Check the proper handling of CUDA driver API error codes.

test_check_runtime_status() NoneView on GitHub

Check the proper handling of CUDA runtime API error codes.

test_device_count() NoneView on GitHub

There must be at least one device.

test_get_device_attribute() NoneView on GitHub

Retrieve a few device attributes.

test_get_device_compute_capability() NoneView on GitHub

Retrieve the compute capability of all devices available.

test_get_device_name() NoneView on GitHub

Get the device name.

test_get_device_total_memory() NoneView on GitHub

Get the device total memory.

test_initialize() NoneView on GitHub

Test it can be successfully loaded.