Skip to content

Commit

Permalink
fix err
Browse files Browse the repository at this point in the history
Signed-off-by: Klaus Ma <klausm@nvidia.com>
  • Loading branch information
k82cn committed Feb 9, 2025
1 parent fa56ff7 commit eaa2835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/pi/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rand::distr::{Distribution, Uniform};

use flame_rs::{
self as flame,
apis::{FlameError, TaskOutput},
apis::{FlameError, TaskOutput, TaskInput},
service::{SessionContext, TaskContext},
};

Expand All @@ -34,7 +34,7 @@ impl flame::service::FlameService for PiService {
let mut rng = rand::rng();
let die = Uniform::try_from(0.0..1.0).unwrap();

let input = ctx.input.unwrap_or(util::zero_u32());
let input = ctx.input.unwrap_or(TaskInput::from(util::zero_u32()));
let total = util::bytes_to_u32(input.to_vec())?;
let mut sum = 0u32;

Expand Down
7 changes: 4 additions & 3 deletions examples/pi/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

use flame_rs::apis::{FlameError, TaskOutput};
use flame_rs::apis::FlameError;

pub fn zero_u32() -> TaskOutput {
TaskOutput::from(vec![0u8, 0u8, 0u8, 0u8])
#[allow(dead_code)]
pub fn zero_u32() -> Vec<u8> {
vec![0u8, 0u8, 0u8, 0u8]
}

pub fn u32_to_bytes(i: u32) -> Vec<u8> {
Expand Down

0 comments on commit eaa2835

Please sign in to comment.