Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to stable #10

Merged
merged 5 commits into from
Dec 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ license = "MIT"
[dependencies]
libc = "0.2"
bitflags = "0.3"
rblas = "0.0.10"
rblas = "0.0.11"
enum_primitive = "0.1.0"
byteorder = "0.4"
num = "0.1"
lazy_static = "0.1.15"

clippy = { version = "0.0.27", optional = true }

Expand Down
3 changes: 2 additions & 1 deletion src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ pub trait IFramework {
///
/// For convention, let the ID be uppercase.<br/>
/// EXAMPLE: OPENCL
const ID: &'static str;
#[allow(non_snake_case)]
fn ID() -> &'static str;

/// Initializes a new Framework.
///
Expand Down
3 changes: 2 additions & 1 deletion src/frameworks/cuda/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ impl IFramework for Cuda {
type H = Device;
type D = Context;
type B = Module;
const ID: &'static str = "CUDA";

fn ID() -> &'static str { "CUDA" }

fn new() -> Cuda {
match Cuda::load_hardwares() {
Expand Down
2 changes: 1 addition & 1 deletion src/frameworks/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl IFramework for Native {
type D = Cpu;
type B = Binary;

const ID: &'static str = "NATIVE";
fn ID() -> &'static str { "NATIVE" }

fn new() -> Native {
match Native::load_hardwares() {
Expand Down
6 changes: 4 additions & 2 deletions src/frameworks/opencl/api/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::types as cl;
use super::ffi::*;
use std::ptr;
use std::iter::repeat;
use std::sync::{StaticMutex, MUTEX_INIT};
use std::sync::Mutex;

impl API {
/// Returns a list of available platforms.
Expand All @@ -22,7 +22,9 @@ impl API {
// This mutex is used to work around weak OpenCL implementations.
// On some implementations concurrent calls to clGetPlatformIDs
// will cause the implantation to return invalid status.
static mut platforms_mutex: StaticMutex = MUTEX_INIT;
lazy_static! {
static ref platforms_mutex: Mutex<()> = Mutex::new(());
}

let guard = unsafe {platforms_mutex.lock()};
try!(unsafe {API::ffi_get_platform_ids(0, ptr::null_mut(), (&mut num_platforms))});
Expand Down
3 changes: 2 additions & 1 deletion src/frameworks/opencl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ impl IFramework for OpenCL {
type H = Device;
type D = Context;
type B = Program;
const ID: &'static str = "OPENCL";

fn ID() -> &'static str { "OPENCL" }

fn new() -> OpenCL {
match OpenCL::load_hardwares() {
Expand Down
6 changes: 2 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@
#![cfg_attr(lint, feature(plugin))]
#![cfg_attr(lint, plugin(clippy))]
#![allow(dead_code)]
#![feature(associated_consts)]
#![feature(associated_type_defaults)]
#![feature(unboxed_closures)]
#![feature(static_mutex)]
#![deny(missing_docs,
missing_debug_implementations, missing_copy_implementations,
trivial_casts, trivial_numeric_casts,
Expand All @@ -148,6 +144,8 @@ extern crate libc;
extern crate bitflags;
#[macro_use]
extern crate enum_primitive;
#[macro_use]
extern crate lazy_static;
extern crate num;
extern crate byteorder;
extern crate rblas as blas;
Expand Down