annotate bqvec/src/Allocators.cpp @ 370:20e0443aa31c

Remove unused member
author Chris Cannam
date Mon, 10 Oct 2016 17:00:36 +0100
parents 5d0a2ebb4d17
children af71cbdab621
rev   line source
Chris@366 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@366 2
Chris@366 3 /*
Chris@366 4 bqvec
Chris@366 5
Chris@366 6 A small library for vector arithmetic and allocation in C++ using
Chris@366 7 raw C pointer arrays.
Chris@366 8
Chris@366 9 Copyright 2007-2014 Particular Programs Ltd.
Chris@366 10
Chris@366 11 Permission is hereby granted, free of charge, to any person
Chris@366 12 obtaining a copy of this software and associated documentation
Chris@366 13 files (the "Software"), to deal in the Software without
Chris@366 14 restriction, including without limitation the rights to use, copy,
Chris@366 15 modify, merge, publish, distribute, sublicense, and/or sell copies
Chris@366 16 of the Software, and to permit persons to whom the Software is
Chris@366 17 furnished to do so, subject to the following conditions:
Chris@366 18
Chris@366 19 The above copyright notice and this permission notice shall be
Chris@366 20 included in all copies or substantial portions of the Software.
Chris@366 21
Chris@366 22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Chris@366 23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Chris@366 24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Chris@366 25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
Chris@366 26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
Chris@366 27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
Chris@366 28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Chris@366 29
Chris@366 30 Except as contained in this notice, the names of Chris Cannam and
Chris@366 31 Particular Programs Ltd shall not be used in advertising or
Chris@366 32 otherwise to promote the sale, use or other dealings in this
Chris@366 33 Software without prior written authorization.
Chris@366 34 */
Chris@366 35
Chris@366 36 #include "bqvec/Allocators.h"
Chris@366 37
Chris@366 38 #ifdef HAVE_IPP
Chris@366 39 #include <ipps.h>
Chris@366 40 #endif
Chris@366 41
Chris@366 42 #include <iostream>
Chris@366 43 using std::cerr;
Chris@366 44 using std::endl;
Chris@366 45
Chris@366 46 namespace breakfastquay {
Chris@366 47
Chris@366 48 #ifdef HAVE_IPP
Chris@366 49
Chris@366 50 template <>
Chris@366 51 float *allocate(size_t count)
Chris@366 52 {
Chris@366 53 float *ptr = ippsMalloc_32f(count);
Chris@366 54 if (!ptr) throw (std::bad_alloc());
Chris@366 55 return ptr;
Chris@366 56 }
Chris@366 57
Chris@366 58 template <>
Chris@366 59 double *allocate(size_t count)
Chris@366 60 {
Chris@366 61 double *ptr = ippsMalloc_64f(count);
Chris@366 62 if (!ptr) throw (std::bad_alloc());
Chris@366 63 return ptr;
Chris@366 64 }
Chris@366 65
Chris@366 66 template <>
Chris@366 67 void deallocate(float *ptr)
Chris@366 68 {
Chris@366 69 if (ptr) ippsFree((void *)ptr);
Chris@366 70 }
Chris@366 71
Chris@366 72 template <>
Chris@366 73 void deallocate(double *ptr)
Chris@366 74 {
Chris@366 75 if (ptr) ippsFree((void *)ptr);
Chris@366 76 }
Chris@366 77
Chris@366 78 #endif
Chris@366 79
Chris@366 80 }
Chris@366 81