File tree 6 files changed +97
-1
lines changed
6 files changed +97
-1
lines changed Original file line number Diff line number Diff line change 17
17
py_binary (
18
18
name = "create" ,
19
19
srcs = ["create.py" ],
20
+ visibility = ["//visibility:public" ],
20
21
deps = [
21
22
"//programl/ir/llvm/py:llvm" ,
22
23
"//programl/proto:features_py" ,
Original file line number Diff line number Diff line change 13
13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
- """Prepare the CPU/GPU OpenCL device-mapping dataset."""
16
+ """Prepare the CPU/GPU OpenCL device-mapping dataset.
17
+
18
+ This script downloads the necessary datasets and produces the devmap downstream task dataset.
19
+
20
+ Usage:
21
+
22
+ $ bazel run //programl/task/devmap/dataset:create -- --path=/path/to/devmap
23
+ """
17
24
import io
18
25
import os
19
26
import shutil
Original file line number Diff line number Diff line change @@ -3116,6 +3116,18 @@ py_binary(
3116
3116
],
3117
3117
)
3118
3118
3119
+ genrule (
3120
+ name = "devmap_dataset" ,
3121
+ testonly = 1 ,
3122
+ outs = ["devmap_dataset.tar.bz2" ],
3123
+ cmd = (
3124
+ "$(location //programl/task/devmap/dataset:create) --path=$(@D)/dtmp && " +
3125
+ "tar cjf $(@D)/devmap_dataset.tar.bz2 -C $(@D)/dtmp . && " +
3126
+ "rm -rf $(@D)/dtmp"
3127
+ ),
3128
+ tools = ["//programl/task/devmap/dataset:create" ],
3129
+ )
3130
+
3119
3131
genrule (
3120
3132
name = "reachability_dataflow_dataset" ,
3121
3133
testonly = 1 ,
Original file line number Diff line number Diff line change @@ -37,6 +37,25 @@ py_test(
37
37
],
38
38
)
39
39
40
+ py_library (
41
+ name = "devmap_dataset" ,
42
+ testonly = 1 ,
43
+ srcs = ["devmap_dataset.py" ],
44
+ data = ["//programl/test/data:devmap_dataset" ],
45
+ deps = [
46
+ "//third_party/py/labm8" ,
47
+ ],
48
+ )
49
+
50
+ py_test (
51
+ name = "devmap_dataset_test" ,
52
+ srcs = ["devmap_dataset.py" ],
53
+ deps = [
54
+ ":devmap_dataset" ,
55
+ "//third_party/py/labm8" ,
56
+ ],
57
+ )
58
+
40
59
py_library (
41
60
name = "llvm_ir" ,
42
61
testonly = 1 ,
Original file line number Diff line number Diff line change
1
+ # Copyright 2019-2020 the ProGraML authors.
2
+ #
3
+ # Contact Chris Cummins <[email protected] >.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ from pathlib import Path
17
+
18
+ from labm8 .py import bazelutil
19
+
20
+ DEVMAP_DATASET = bazelutil .DataArchive ("programl/test/data/devmap_dataset.tar.bz2" )
21
+
22
+
23
+ @test .Fixture (scope = "function" )
24
+ def devmap_dataset () -> Path :
25
+ """A test fixture which yields the root of the devmap dataset."""
26
+ with DEVMAP_DATASET as d :
27
+ yield d
Original file line number Diff line number Diff line change
1
+ # Copyright 2019-2020 the ProGraML authors.
2
+ #
3
+ # Contact Chris Cummins <[email protected] >.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+ """Unit tests for //programl/test/py/plugins:devmap_dataset."""
17
+ from pathlib import Path
18
+
19
+ from labm8 .py import test
20
+
21
+ pytest_plugins = ["programl.test.py.plugins.devmap_dataset" ]
22
+
23
+
24
+ def test_devmap_dataset (devmap_dataset : Path ):
25
+ assert (devmap_dataset / "ir" ).is_dir ()
26
+ assert (devmap_dataset / "graphs" ).is_dir ()
27
+
28
+
29
+ if __name__ == "__main__" :
30
+ test .Main ()
You can’t perform that action at this time.
0 commit comments