Skip to content

Commit 4e86043

Browse files
committed
2018 edition changes
1 parent 6b9637c commit 4e86043

File tree

30 files changed

+141
-170
lines changed

30 files changed

+141
-170
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[package]
2+
edition = "2018"
23
name = "arrayfire"
34
description = "ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. This crate provides Rust bindings for ArrayFire library."
45
version = "3.6.0"

examples/acoustic_wave.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
extern crate arrayfire as af;
2-
3-
use af::*;
41
use std::f64::consts::*;
2+
use arrayfire::*;
53

64
fn main() {
75
set_device(0);
@@ -74,7 +72,7 @@ fn acoustic_wave_simulation() {
7472
}
7573

7674
// Draw the image.
77-
win.set_colormap(af::ColorMap::BLUE);
75+
win.set_colormap(ColorMap::BLUE);
7876
win.draw_image(&normalise(&p), None);
7977

8078
it += 1;

examples/conway.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
extern crate arrayfire as af;
2-
3-
use af::*;
1+
use arrayfire::*;
42

53
fn main() {
64
set_device(0);

examples/helloworld.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
#[macro_use(af_print)]
2-
extern crate arrayfire as af;
3-
extern crate num;
4-
5-
use af::*;
1+
use arrayfire::*;
62

73
#[allow(unused_must_use)]
84
fn main() {

examples/histogram.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
extern crate arrayfire as af;
2-
3-
use af::*;
41
use std::env;
52
use std::path::PathBuf;
3+
use arrayfire::*;
64

75
#[allow(unused_variables)]
86
#[allow(unused_must_use)]

examples/pi.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#[macro_use(mem_info)]
2-
extern crate arrayfire as af;
3-
41
use std::time::Instant;
5-
use af::*;
2+
use arrayfire::*;
63

74
#[allow(unused_must_use)]
85
#[allow(unused_variables)]
@@ -25,7 +22,7 @@ fn main() {
2522
let xplusy = &add(xsqrd, ysqrd, false);
2623
let root = &sqrt(xplusy);
2724
let cnst = &constant(1, dims);
28-
let (real, imag) = sum_all(&le(root, cnst, false));
25+
let (real, imag) = sum_all(&le(root, cnst, false));
2926
let pi_val = real*4.0/(samples as f64);
3027
}
3128

examples/snow.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
extern crate arrayfire as af;
2-
3-
use af::*;
1+
use arrayfire::*;
42

53
#[allow(unused_variables)]
64
#[allow(unused_must_use)]

examples/unified.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
extern crate arrayfire as af;
2-
3-
use af::*;
1+
use arrayfire::*;
42

53
#[cfg(op_assign)]
64
fn helper(dims: Dim4) {

src/algorithm/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
extern crate libc;
22

3-
use array::Array;
4-
use defines::{AfError, BinaryOp};
5-
use error::HANDLE_ERROR;
3+
use crate::array::Array;
4+
use crate::defines::{AfError, BinaryOp};
5+
use crate::error::HANDLE_ERROR;
66
use self::libc::{c_int, c_uint, c_double};
7-
use util::{AfArray, MutAfArray, MutDouble, MutUint};
8-
use util::{HasAfEnum, Scanable, RealNumber};
7+
use crate::util::{AfArray, MutAfArray, MutDouble, MutUint};
8+
use crate::util::{HasAfEnum, Scanable, RealNumber};
99

1010
#[allow(dead_code)]
1111
extern {

src/arith/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
extern crate libc;
22
extern crate num;
33

4-
use dim4::Dim4;
5-
use array::Array;
6-
use defines::{AfError};
7-
use error::HANDLE_ERROR;
4+
use crate::dim4::Dim4;
5+
use crate::array::Array;
6+
use crate::defines::{AfError};
7+
use crate::error::HANDLE_ERROR;
88
use self::libc::{c_int};
9-
use data::{constant, ConstGenerator, tile};
9+
use crate::data::{constant, ConstGenerator, tile};
1010
use self::num::Complex;
11-
use num::Zero;
12-
use util::{AfArray, HasAfEnum, ImplicitPromote, MutAfArray};
11+
use crate::num::Zero;
12+
use crate::util::{AfArray, HasAfEnum, ImplicitPromote, MutAfArray};
1313
use std::ops::Neg;
1414
use std::ops::{Add, Sub, Div, Mul, BitAnd, BitOr, BitXor, Not, Rem, Shl, Shr};
1515

@@ -565,10 +565,10 @@ arith_func!(BitXor, bitxor, bitxor);
565565
#[cfg(op_assign)]
566566
mod op_assign {
567567

568-
use array::Array;
568+
use crate::array::Array;
569569
use super::*;
570-
use index::{Indexer, assign_gen};
571-
use seq::Seq;
570+
use crate::index::{Indexer, assign_gen};
571+
use crate::seq::Seq;
572572
use std::mem;
573573
use std::ops::{AddAssign, SubAssign, DivAssign, MulAssign, RemAssign};
574574
use std::ops::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign};

0 commit comments

Comments
 (0)