-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor three_billion_instructions into library
Summary: Want to use it in a test for code to measure current thread instruction counts. Reviewed By: krallin Differential Revision: D54375084 fbshipit-source-id: 0dc23a11e94136604c23541352a93dcd6bf28172
- Loading branch information
1 parent
7861e7e
commit b98fd06
Showing
4 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") | ||
load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") | ||
load("@fbsource//tools/build_defs:glob_defs.bzl", "glob") | ||
|
||
oncall("build_infra") | ||
|
||
rust_binary( | ||
rust_library( | ||
name = "three_billion_instructions", | ||
srcs = glob( | ||
["src/**/*.rs"], | ||
), | ||
) | ||
|
||
rust_binary( | ||
name = "three_billion_instructions-bin", | ||
srcs = ["bin/three_billion_instructions.rs"], | ||
crate_root = "bin/three_billion_instructions.rs", | ||
deps = [ | ||
":three_billion_instructions", | ||
], | ||
) |
15 changes: 15 additions & 0 deletions
15
shed/three_billion_instructions/bin/three_billion_instructions.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under both the MIT license found in the | ||
* LICENSE-MIT file in the root directory of this source tree and the Apache | ||
* License, Version 2.0 found in the LICENSE-APACHE file in the root directory | ||
* of this source tree. | ||
*/ | ||
|
||
use three_billion_instructions::three_billion_instructions; | ||
|
||
/// Run 3B instructions. | ||
fn main() { | ||
three_billion_instructions(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters