python_code stringlengths 0 4.04M | repo_name stringlengths 8 58 | file_path stringlengths 5 147 |
|---|---|---|
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/wrappers."""
from compiler_gym.envs.llvm import LlvmEnv
from compiler_gym.wrappers import ForkOnStep
from test... | CompilerGym-development | tests/wrappers/fork_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/loop_tool/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the loop_tool CompilerGym environment."""
import loop_tool_py as lt
import pytest
from flaky import flaky
import co... | CompilerGym-development | tests/loop_tool/actions_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test for LlvmEnv.fork()."""
import numpy as np
import pytest
from compiler_gym.envs import LlvmEnv
from tests.test_main import main
p... | CompilerGym-development | tests/fuzzing/llvm_fork_env_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
from time import time
import gym
import numpy as np
import pytest
from compi... | CompilerGym-development | tests/fuzzing/llvm_random_actions_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/fuzzing/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test for LlvmEnv.action_space.to_string()."""
import os
import subprocess
from pathlib import Path
import pytest
from compiler_gym.en... | CompilerGym-development | tests/fuzzing/llvm_commandline_opt_equivalence_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test for LlvmEnv.validate()."""
import numpy as np
import pytest
from compiler_gym.envs import LlvmEnv
from compiler_gym.errors import... | CompilerGym-development | tests/fuzzing/llvm_trajectory_replay_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for action space determinism."""
import hashlib
import random
import pytest
from compiler_gym.envs import LlvmEnv
from tests.pytest_... | CompilerGym-development | tests/fuzzing/llvm_deterministic_action_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test for LlvmEnv.validate()."""
import random
import pytest
from compiler_gym.envs import LlvmEnv
from tests.pytest_plugins.llvm impo... | CompilerGym-development | tests/fuzzing/llvm_cbench_validate_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Fuzz test LLVM backend using llvm-stress."""
import pytest
from compiler_gym.envs import LlvmEnv
from compiler_gym.errors import BenchmarkI... | CompilerGym-development | tests/fuzzing/llvm_stress_fuzz_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:capture_output."""
import sys
from compiler_gym.util.capture_output import capture_output
from tests.tes... | CompilerGym-development | tests/util/capture_output_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:timer."""
import logging
import os
from compiler_gym.util import debug_util as dbg
from tests.test_main ... | CompilerGym-development | tests/util/debug_util_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:download."""
import pytest
from compiler_gym.errors import DownloadFailed, TooManyRequests
from compiler... | CompilerGym-development | tests/util/download_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym/util/shell_format.py"""
from compiler_gym.util import shell_format as fmt
from tests.test_main import main
def... | CompilerGym-development | tests/util/shell_format_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym/util/locks.py"""
from datetime import datetime
from pathlib import Path
from threading import Thread
from flaky... | CompilerGym-development | tests/util/runfiles_path_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym.util.executor."""
import sys
from typing import Iterable
import pytest
from compiler_gym.util.executor import ... | CompilerGym-development | tests/util/executor_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:timer."""
from time import sleep
from compiler_gym.util import timer
from tests.test_main import main
... | CompilerGym-development | tests/util/timer_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:parallelization."""
from compiler_gym.util import parallelization
from tests.test_main import main
def ... | CompilerGym-development | tests/util/parallelization_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:truncate."""
from compiler_gym.util.truncate import truncate, truncate_lines
from tests.test_main import ... | CompilerGym-development | tests/util/truncate_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/util/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym.util.commands."""
import subprocess
import pytest
from compiler_gym.util.commands import Popen, communicate
fr... | CompilerGym-development | tests/util/commands_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:filesystem."""
from pathlib import Path
import pytest
from compiler_gym.util import filesystem
from tes... | CompilerGym-development | tests/util/filesystem_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:temporary_working_directory."""
import os
import tempfile
from pathlib import Path
from compiler_gym.uti... | CompilerGym-development | tests/util/temporary_working_directory_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:statistics."""
from pytest import approx
from compiler_gym.util.statistics import geometric_mean
from te... | CompilerGym-development | tests/util/statistics_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/util:minimize_trajectory."""
import logging
import sys
from typing import List
import pytest
from compiler_g... | CompilerGym-development | tests/util/minimize_trajectory_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import compiler_gym.util.permutation as permutation
from tests.test_main import main
def test_permutation_number_mapping(... | CompilerGym-development | tests/util/permutation_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for //compiler_gym/bin:manual_env."""
import re
import sys
from difflib import unified_diff
from io import StringIO
from random import... | CompilerGym-development | tests/bin/manual_env_bin_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/bin:validate."""
import tempfile
from io import StringIO
from pathlib import Path
from typing import List
imp... | CompilerGym-development | tests/bin/validate_bin_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/bin/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/bin:service."""
import sys
import gym
import pytest
from absl import flags
import compiler_gym
from compiler... | CompilerGym-development | tests/bin/service_bin_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym.datasets.uri."""
from compiler_gym.datasets import BenchmarkUri
from tests.test_main import main
pytest_plugins... | CompilerGym-development | tests/datasets/uri_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/datasets:files_dataset_test."""
import tempfile
from pathlib import Path
import numpy as np
import pytest
fr... | CompilerGym-development | tests/datasets/files_dataset_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/datasets/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/datasets."""
from pathlib import Path
import numpy as np
import pytest
from compiler_gym.datasets.datasets i... | CompilerGym-development | tests/datasets/datasets_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/datasets."""
from pathlib import Path
import pytest
from compiler_gym.datasets.dataset import Dataset
from c... | CompilerGym-development | tests/datasets/dataset_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/datasets:benchmark."""
from pathlib import Path
import pytest
from compiler_gym.datasets import Benchmark, B... | CompilerGym-development | tests/datasets/benchmark_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/spaces:scalar."""
from compiler_gym.spaces import Commandline, CommandlineFlag
from tests.test_main import mai... | CompilerGym-development | tests/spaces/commandline_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from gym.spaces import Discrete
from compiler_gym.spaces import Dict
from tests.test_main import main
def test_equal():
assert Dict({"a... | CompilerGym-development | tests/spaces/dict_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/spaces:sequence."""
from copy import deepcopy
import pytest
from compiler_gym.spaces import Scalar, Sequence... | CompilerGym-development | tests/spaces/sequence_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from gym.spaces import Discrete
from compiler_gym.spaces import Tuple
from tests.test_main import main
def test_equal():
assert Tuple([... | CompilerGym-development | tests/spaces/tuple_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym/spaces/action_space.py."""
from compiler_gym.spaces import ActionSpace, Discrete, NamedDiscrete
from tests.test_... | CompilerGym-development | tests/spaces/action_space_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/spaces/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/spaces:named_discrete."""
import pytest
from compiler_gym.spaces import NamedDiscrete
from tests.test_main im... | CompilerGym-development | tests/spaces/named_discrete_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for compiler_gym.spaces.Reward."""
from copy import deepcopy
from compiler_gym.spaces import Reward
from tests.test_main import ... | CompilerGym-development | tests/spaces/reward_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Unit tests for //compiler_gym/spaces:scalar."""
from copy import copy, deepcopy
from compiler_gym.spaces import Scalar
from tests.test_main... | CompilerGym-development | tests/spaces/scalar_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from compiler_gym.spaces import Box
from tests.test_main import main
def test_equal():
assert Box(low=0, high=1, name="test_box", shape=[... | CompilerGym-development | tests/spaces/box_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from compiler_gym.spaces import Discrete
from tests.test_main import main
def test_equal():
assert Discrete(2, name="test_discrete") == D... | CompilerGym-development | tests/spaces/discrete_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from compiler_gym.spaces import Permutation, Scalar
from tests.test_main import main
def test_invalid_scalar_range_dtype():
... | CompilerGym-development | tests/spaces/permutation_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
from enum import Enum
from io import StringIO
from pathlib import Path
from typ... | CompilerGym-development | tests/llvm/llvm_env_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for LLVM benchmark handling."""
import pytest
from compiler_gym.envs import llvm
from compiler_gym.envs.llvm import LlvmEnv
from comp... | CompilerGym-development | tests/llvm/invalid_ir_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for LLVM benchmark handling."""
import re
import subprocess
import tempfile
from pathlib import Path
import gym
import pytest
from c... | CompilerGym-development | tests/llvm/custom_benchmarks_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Regression tests for LlvmEnv.validate()."""
from io import StringIO
import pytest
from compiler_gym import CompilerEnvStateReader
from com... | CompilerGym-development | tests/llvm/validation_regression_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import gym
import numpy as np
import pytest
import compiler_gym # noqa Regist... | CompilerGym-development | tests/llvm/service_connection_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for LlvmEnv.episode_reward."""
from compiler_gym.envs import LlvmEnv
from tests.test_main import main
pytest_plugins = ["tests.pytest... | CompilerGym-development | tests/llvm/episode_reward_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import os
import sys
from typing import Any, Dict, List, NamedTuple
import gym... | CompilerGym-development | tests/llvm/observation_spaces_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for splitting and merging benchmarks."""
import random
import pytest
from compiler_gym.datasets import Benchmark
from c... | CompilerGym-development | tests/llvm/split_merge_integration_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
from threading import Thread
from typing import List
import gym
from flaky imp... | CompilerGym-development | tests/llvm/threading_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the LLVM environment action space."""
from compiler_gym.envs.llvm.llvm_env import LlvmEnv
from tests.test_main import main
pytest... | CompilerGym-development | tests/llvm/action_space_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import multiprocessing as mp
import sys
from typing import List
import gym
imp... | CompilerGym-development | tests/llvm/multiprocessing_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests that module and source IDs are stripped in the LLVM modules."""
from compiler_gym.envs.llvm import LlvmEnv
from tests.test_main import... | CompilerGym-development | tests/llvm/module_id_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the compute_observation() function."""
from pathlib import Path
import networkx.algorithms.isomorphism
import pytest
from compil... | CompilerGym-development | tests/llvm/compute_observation_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
from compiler_gym.envs import CompilerEnv
from tests.test_main import main
pyt... | CompilerGym-development | tests/llvm/autophase_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import numpy as np
import pytest
from compiler_gym.envs.llvm.llvm_env import L... | CompilerGym-development | tests/llvm/reward_spaces_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/llvm/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import tempfile
from pathlib import Path
import gym
import pytest
from compil... | CompilerGym-development | tests/llvm/validate_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import sys
import pytest
from flaky import flaky
from compiler_gym.envs impor... | CompilerGym-development | tests/llvm/fresh_environment_observation_reward_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for LLVM session parameter handlers."""
import pytest
from flaky import flaky
from compiler_gym.envs.llvm import LlvmEnv
from compile... | CompilerGym-development | tests/llvm/llvm_session_parameters_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
from concurrent.futures import ThreadPoolExecutor
from pathlib import Path
from compiler_gym.third_party import llvm
from compiler_g... | CompilerGym-development | tests/llvm/download_llvm_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Test that LlvmEnv is compatible with OpenAI gym interface."""
import gym
import pytest
from compiler_gym.envs.llvm import LlvmEnv
from test... | CompilerGym-development | tests/llvm/gym_interface_compatability_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import re
import tempfile
from pathlib import Path
import pytest
from compile... | CompilerGym-development | tests/llvm/llvm_benchmark_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Regression tests generated by fuzzing."""
import difflib
import subprocess
import pytest
from tests.test_main import main
pytest_plugins ... | CompilerGym-development | tests/llvm/fuzzing_regression_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Regression tests for LlvmEnv.fork() identified by hand or through fuzzing."""
from typing import List, NamedTuple
import pytest
from flaky... | CompilerGym-development | tests/llvm/fork_regression_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for LlvmEnv.fork()."""
import subprocess
import sys
import pytest
from compiler_gym.envs import LlvmEnv
from compiler_gym.util.runfi... | CompilerGym-development | tests/llvm/fork_env_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for LLVM runtime support."""
from pathlib import Path
from typing import List
import numpy as np
import pytest
from flak... | CompilerGym-development | tests/llvm/runtime_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integrations tests for the LLVM CompilerGym environments."""
import numpy as np
from compiler_gym.envs import CompilerEnv
from compiler_gy... | CompilerGym-development | tests/llvm/all_actions_single_step_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for serializing LLVM datasets."""
import pickle
from compiler_gym.datasets import Dataset
from compiler_gym.envs.llvm import LlvmEnv
... | CompilerGym-development | tests/llvm/datasets_pickle_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the LLVM datasets."""
import gym
import compiler_gym.envs.llvm # noqa register environments
from tests.test_main import main
d... | CompilerGym-development | tests/llvm/datasets/llvm_datasets_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the POJ104 dataset."""
import sys
from itertools import islice
from pathlib import Path
import gym
import pytest
import compiler... | CompilerGym-development | tests/llvm/datasets/poj104_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the GitHub dataset."""
import sys
from itertools import islice
import gym
import pytest
import compiler_gym.envs.llvm # noqa re... | CompilerGym-development | tests/llvm/datasets/github_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the AnghaBench dataset."""
import gym
import pytest
import compiler_gym.envs.llvm # noqa register environments
from compiler_gym... | CompilerGym-development | tests/llvm/datasets/chstone_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Test for cBench semantics validation."""
import pytest
from compiler_gym import ValidationResult
from compiler_gym.envs.llvm import LlvmEnv... | CompilerGym-development | tests/llvm/datasets/cbench_validate_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/llvm/datasets/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the AnghaBench dataset."""
import sys
from itertools import islice
import gym
import numpy as np
import pytest
import compiler_g... | CompilerGym-development | tests/llvm/datasets/llvm_stress_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the JotaiBench dataset."""
from itertools import islice
from pathlib import Path
import pytest
import compiler_gym
from compiler... | CompilerGym-development | tests/llvm/datasets/jotaibench_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the CLgen dataset."""
from itertools import islice
from pathlib import Path
import gym
import pytest
import compiler_gym.envs.ll... | CompilerGym-development | tests/llvm/datasets/clgen_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the Csmith dataset."""
from itertools import islice
from pathlib import Path
import gym
import numpy as np
import pytest
from fla... | CompilerGym-development | tests/llvm/datasets/csmith_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the AnghaBench dataset."""
import sys
from itertools import islice
from pathlib import Path
import gym
import pytest
import comp... | CompilerGym-development | tests/llvm/datasets/anghabench_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the cbench dataset."""
import tempfile
from pathlib import Path
import pytest
from compiler_gym.envs.llvm import LlvmEnv
from co... | CompilerGym-development | tests/llvm/datasets/cbench_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the GCC CompilerGym service."""
import re
import gym
import numpy as np
import pytest
import compiler_gym.envs.gcc # noqa regis... | CompilerGym-development | tests/gcc/gcc_env_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the GCC CompilerGym service."""
import gym
import pytest
import compiler_gym.envs.gcc # noqa register environments
from compiler... | CompilerGym-development | tests/gcc/gcc_docker_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/gcc/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the GCC CompilerGym service."""
import gym
import pytest
import compiler_gym.envs.gcc # noqa register environments
from compiler... | CompilerGym-development | tests/gcc/gcc_bin_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/gcc/datasets/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the Csmith dataset."""
from itertools import islice
from pathlib import Path
import gym
import numpy as np
import pytest
from co... | CompilerGym-development | tests/gcc/datasets/csmith_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for the AnghaBench dataset."""
import sys
from itertools import islice
import gym
import pytest
import compiler_gym.envs.gcc # noqa... | CompilerGym-development | tests/gcc/datasets/anghabench_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Tests for //compiler_gym/leaderboard:llvm_instcount."""
from pathlib import Path
import pytest
from absl import flags
from compiler_gym.le... | CompilerGym-development | tests/leaderboard/llvm_instcount_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/leaderboard/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Integration tests for the MLIR CompilerGym environments."""
from numbers import Real
import gym
import numpy as np
import pytest
import co... | CompilerGym-development | tests/mlir/mlir_env_test.py |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE file
# in the root directory of this source tree.
#
# tests/**/__init__.py files are needed for pytest Python path resolution. See:
# https://docs.pytest.org/en/latest/explanation/pythonpath.ht... | CompilerGym-development | tests/mlir/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.