[python-arrayfire] 05/08: Add support for short types

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Fri Sep 16 09:30:05 UTC 2016


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository python-arrayfire.

commit c53dd65f099493ab13a38a86fe57d078ed50c66a
Author: aha66 <andreas at aha66.at>
Date:   Mon Jun 20 23:13:21 2016 +0200

    Add support for short types
    
    * Update array.py
    
    * Update util.py
    
    * Update util.py
---
 arrayfire/array.py | 4 ++++
 arrayfire/util.py  | 8 ++++++++
 2 files changed, 12 insertions(+)

diff --git a/arrayfire/array.py b/arrayfire/array.py
index ede0da0..06db29a 100644
--- a/arrayfire/array.py
+++ b/arrayfire/array.py
@@ -300,6 +300,8 @@ class Array(BaseArray):
                - 'd' for double
                - 'b' for bool
                - 'B' for unsigned char
+               - 'h' for signed 16 bit integer
+               - 'H' for unsigned 16 bit integer
                - 'i' for signed 32 bit integer
                - 'I' for unsigned 32 bit integer
                - 'l' for signed 64 bit integer
@@ -311,6 +313,8 @@ class Array(BaseArray):
                - Dtype.f64 for double
                - Dtype.b8  for bool
                - Dtype.u8  for unsigned char
+               - Dtype.s16 for signed 16 bit integer
+               - Dtype.u16 for unsigned 16 bit integer
                - Dtype.s32 for signed 32 bit integer
                - Dtype.u32 for unsigned 32 bit integer
                - Dtype.s64 for signed 64 bit integer
diff --git a/arrayfire/util.py b/arrayfire/util.py
index fe3e225..35cc5a8 100644
--- a/arrayfire/util.py
+++ b/arrayfire/util.py
@@ -98,6 +98,8 @@ to_dtype = {'f' : Dtype.f32,
             'd' : Dtype.f64,
             'b' : Dtype.b8,
             'B' : Dtype.u8,
+            'h' : Dtype.s16,
+            'H' : Dtype.u16,
             'i' : Dtype.s32,
             'I' : Dtype.u32,
             'l' : Dtype.s64,
@@ -109,6 +111,8 @@ to_typecode = {Dtype.f32.value : 'f',
                Dtype.f64.value : 'd',
                Dtype.b8.value : 'b',
                Dtype.u8.value : 'B',
+               Dtype.s16.value : 'h',
+               Dtype.u16.value : 'H',
                Dtype.s32.value : 'i',
                Dtype.u32.value : 'I',
                Dtype.s64.value : 'l',
@@ -120,6 +124,8 @@ to_c_type = {Dtype.f32.value : ct.c_float,
              Dtype.f64.value : ct.c_double,
              Dtype.b8.value : ct.c_char,
              Dtype.u8.value : ct.c_ubyte,
+             Dtype.s16.value : ct.c_short,
+             Dtype.u16.value : ct.c_ushort,
              Dtype.s32.value : ct.c_int,
              Dtype.u32.value : ct.c_uint,
              Dtype.s64.value : ct.c_longlong,
@@ -131,6 +137,8 @@ to_typename = {Dtype.f32.value : 'float',
                Dtype.f64.value : 'double',
                Dtype.b8.value : 'bool',
                Dtype.u8.value : 'unsigned char',
+               Dtype.s16.value : 'short int',
+               Dtype.u16.value : 'unsigned short int',
                Dtype.s32.value : 'int',
                Dtype.u32.value : 'unsigned int',
                Dtype.s64.value : 'long int',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-arrayfire.git



More information about the debian-science-commits mailing list