PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 140ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tests/functional/func-error.cpp

https://github.com/jinhou/clBLAS
C++ | 1354 lines | 1095 code | 224 blank | 35 comment | 44 complexity | 89b4cef0486c093a07d85744daad4a1b MD5 | raw file
   1/* ************************************************************************
   2 * Copyright 2013 Advanced Micro Devices, Inc.
   3 *
   4 * Licensed under the Apache License, Version 2.0 (the "License");
   5 * you may not use this file except in compliance with the License.
   6 * You may obtain a copy of the License at
   7 *
   8 * http://www.apache.org/licenses/LICENSE-2.0
   9 *
  10 * Unless required by applicable law or agreed to in writing, software
  11 * distributed under the License is distributed on an "AS IS" BASIS,
  12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 * See the License for the specific language governing permissions and
  14 * limitations under the License.
  15 * ************************************************************************/
  16
  17
  18#include <gtest/gtest.h>
  19#include <clBLAS.h>
  20#include "blas-wrapper.h"
  21#include "clBLAS-wrapper.h"
  22#include "BlasBase.h"
  23#include "blas-random.h"
  24#include "timer.h"
  25#include "func.h"
  26
  27
  28
  29template <typename M>
  30class ErrorClass
  31{
  32    M metod;
  33protected:
  34    bool generateData();
  35public:
  36    void error(cl_int err_etalon);
  37//    nano_time_t runRepeat(int rep, cl_int* err);
  38};
  39
  40template <typename T> bool
  41ErrorClass<T>::generateData()
  42{
  43    metod.generateData();
  44    bool ret = metod.prepareDataToRun();
  45
  46    if (!ret) {
  47        ::std::cerr << ">> Failed to create/enqueue buffer for a matrix."
  48            << ::std::endl
  49            << ">> Can't execute the test, because data is not transfered to GPU."
  50            << ::std::endl
  51            << ">> Test skipped." << ::std::endl;
  52        SUCCEED();
  53    }
  54    return ret;
  55}
  56
  57template <typename M> void
  58ErrorClass<M>::error(cl_int err_etalon)
  59{
  60    metod.initDefault(1024, 1);
  61    cl_command_queue queues = metod.queues[0];
  62    if (generateData()) {
  63        switch (err_etalon) {
  64        case CL_INVALID_EVENT_WAIT_LIST:
  65            metod.inEvent = NULL;
  66            metod.inEventCount = 1;
  67            break;
  68        case CL_INVALID_EVENT:
  69            metod.outEvent = NULL;
  70            metod.inEventCount = 1;
  71            break;
  72            case CL_INVALID_CONTEXT:
  73            clReleaseContext(metod.context);
  74            break;
  75        case CL_INVALID_COMMAND_QUEUE:
  76            metod.queues[0] = NULL;
  77            break;
  78        case clblasInvalidMatA:
  79        case clblasInvalidVecX:
  80        case CL_INVALID_MEM_OBJECT:
  81            metod.bufA = NULL;
  82            metod.bufAP = NULL;
  83            metod.bufX = NULL;
  84            metod.bufY = NULL;
  85            break;
  86        case CL_INVALID_DEVICE:
  87            break;
  88        case clblasInsufficientMemMatA:
  89        case clblasInsufficientMemMatB:
  90        case clblasInsufficientMemVecX:
  91        case CL_INVALID_VALUE:
  92			metod.size = 2048;
  93            //metod.bufA = NULL;
  94            break;
  95        default:
  96            FAIL() << "Unknown Error cod " << err_etalon;
  97        }
  98
  99        cl_int err = metod.run();
 100
 101	    metod.queues[0] = queues;
 102
 103        ASSERT_EQ(err, err_etalon) << "clFinish()";
 104
 105    }
 106    metod.destroy();
 107}
 108
 109#ifdef DO_THEIRS
 110// Instantiate the test
 111TEST(ERROR, InvalidCommandQueue) {
 112    ErrorClass<GemmMetod<float> > ec;
 113    ec.error(CL_INVALID_COMMAND_QUEUE);
 114}
 115
 116TEST(ERROR, InvalidEventWaitList) {
 117    ErrorClass<GemmMetod<float> > ec;
 118    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 119}
 120
 121TEST(ERROR, InvalidMemObject) {
 122    ErrorClass<GemmMetod<float> > ec;
 123    ec.error(clblasInvalidMatA);
 124}
 125TEST(ERROR, InvalidValue) {
 126    ErrorClass<GemmMetod<float> > ec;
 127    ec.error(clblasInsufficientMemMatA);
 128}
 129
 130TEST(ERROR, InvalidDevice) {
 131    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 132    if (!base->isDevSupportDoublePrecision()) {
 133        ErrorClass<GemmMetod<double> > ec;
 134        ec.error(CL_INVALID_DEVICE);
 135    }
 136}
 137
 138// Instantiate the test
 139#endif
 140
 141#ifdef DO_TRMV
 142TEST(ERROR, InvalidCommandQueuetrmv) {
 143    ErrorClass<TrmvMetod<FloatComplex> > ec;
 144    ec.error(CL_INVALID_COMMAND_QUEUE);
 145}
 146
 147TEST(ERROR, InvalidEventWaitListtrmv) {
 148    ErrorClass<TrmvMetod<FloatComplex> > ec;
 149    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 150}
 151
 152TEST(ERROR, InvalidMemObjecttrmv) {
 153    ErrorClass<TrmvMetod<FloatComplex> > ec;
 154    ec.error(clblasInvalidMatA);
 155}
 156TEST(ERROR, InvalidValuetrmv) {
 157    ErrorClass<TrmvMetod<FloatComplex> > ec;
 158    ec.error(clblasInsufficientMemMatA);
 159}
 160
 161TEST(ERROR, InvalidDevicetrmv) {
 162    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 163    if (!base->isDevSupportDoublePrecision()) {
 164	ErrorClass<TrmvMetod<cl_double> > ec;
 165        ec.error(CL_INVALID_DEVICE);
 166    }
 167}
 168#endif
 169
 170#ifdef DO_TRSV
 171TEST(ERROR, InvalidCommandQueue_trsv) {
 172    ErrorClass<TrsvMetod<FloatComplex> > ec;
 173    ec.error(CL_INVALID_COMMAND_QUEUE);
 174}
 175
 176TEST(ERROR, InvalidEventWaitList_trsv) {
 177    ErrorClass<TrsvMetod<FloatComplex> > ec;
 178    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 179}
 180
 181TEST(ERROR, InvalidMemObject_trsv) {
 182    ErrorClass<TrsvMetod<FloatComplex> > ec;
 183    ec.error(clblasInvalidMatA);
 184}
 185TEST(ERROR, InvalidValue_trsv) {
 186    ErrorClass<TrsvMetod<FloatComplex> > ec;
 187    ec.error(clblasInsufficientMemMatA);
 188}
 189
 190TEST(ERROR, InvalidDevice_trsv) {
 191    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 192    if (!base->isDevSupportDoublePrecision()) {
 193        ErrorClass<TrsvMetod<double> > ec;
 194        ec.error(CL_INVALID_DEVICE);
 195    }
 196}
 197#endif
 198
 199#ifdef DO_TPSV
 200TEST(ERROR, InvalidCommandQueue_tpsv) {
 201    ErrorClass<TpsvMetod<FloatComplex> > ec;
 202    ec.error(CL_INVALID_COMMAND_QUEUE);
 203}
 204
 205TEST(ERROR, InvalidEventWaitList_tpsv) {
 206    ErrorClass<TpsvMetod<FloatComplex> > ec;
 207    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 208}
 209
 210TEST(ERROR, InvalidMemObject_tpsv) {
 211    ErrorClass<TpsvMetod<FloatComplex> > ec;
 212    ec.error(clblasInvalidMatA);
 213}
 214TEST(ERROR, InvalidValue_tpsv) {
 215    ErrorClass<TpsvMetod<FloatComplex> > ec;
 216    ec.error(clblasInsufficientMemMatA);
 217}
 218
 219TEST(ERROR, InvalidDevice_tpsv) {
 220    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 221    if (!base->isDevSupportDoublePrecision()) {
 222        ErrorClass<TpsvMetod<double> > ec;
 223        ec.error(CL_INVALID_DEVICE);
 224    }
 225}
 226#endif
 227
 228#ifdef DO_TPMV
 229TEST(ERROR, InvalidCommandQueue_tpmv) {
 230    ErrorClass<TpmvMetod<FloatComplex> > ec;
 231    ec.error(CL_INVALID_COMMAND_QUEUE);
 232}
 233
 234TEST(ERROR, InvalidEventWaitList_tpmv) {
 235    ErrorClass<TpmvMetod<FloatComplex> > ec;
 236    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 237}
 238
 239TEST(ERROR, InvalidMemObject_tpmv) {
 240    ErrorClass<TpmvMetod<FloatComplex> > ec;
 241    ec.error(clblasInvalidMatA);
 242}
 243TEST(ERROR, InvalidValue_tpmv) {
 244    ErrorClass<TpmvMetod<FloatComplex> > ec;
 245    ec.error(clblasInsufficientMemMatA);
 246}
 247
 248TEST(ERROR, InvalidDevice_tpmv) {
 249    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 250    if (!base->isDevSupportDoublePrecision()) {
 251        ErrorClass<TpmvMetod<double> > ec;
 252        ec.error(CL_INVALID_DEVICE);
 253    }
 254}
 255#endif
 256
 257
 258#ifdef DO_SYMM
 259TEST(ERROR, InvalidCommandQueuesymm) {
 260    ErrorClass<SymmMetod<FloatComplex> > ec;
 261    ec.error(CL_INVALID_COMMAND_QUEUE);
 262}
 263
 264TEST(ERROR, InvalidEventWaitListsymm) {
 265    ErrorClass<SymmMetod<FloatComplex> > ec;
 266    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 267}
 268
 269TEST(ERROR, InvalidMemObjectsymm) {
 270    ErrorClass<SymmMetod<FloatComplex> > ec;
 271    ec.error(clblasInvalidMatA);
 272}
 273TEST(ERROR, InvalidValuesymm) {
 274    ErrorClass<SymmMetod<FloatComplex> > ec;
 275    ec.error(clblasInsufficientMemMatB);
 276}
 277
 278TEST(ERROR, InvalidDevicesymm) {
 279    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 280    if (!base->isDevSupportDoublePrecision()) {
 281    ErrorClass<SymmMetod<cl_double> > ec;
 282        ec.error(CL_INVALID_DEVICE);
 283    }
 284}
 285#endif
 286
 287#ifdef DO_SYR
 288TEST(ERROR, InvalidCommandQueuesyr) {
 289    ErrorClass<SyrMetod<cl_float> > ec;
 290    ec.error(CL_INVALID_COMMAND_QUEUE);
 291}
 292
 293TEST(ERROR, InvalidEventWaitListsyr) {
 294    ErrorClass<SyrMetod<cl_float> > ec;
 295    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 296}
 297
 298TEST(ERROR, InvalidMemObjectsyr) {
 299    ErrorClass<SyrMetod<cl_float> > ec;
 300    ec.error(clblasInvalidMatA);
 301}
 302TEST(ERROR, InvalidValuesyr) {
 303    ErrorClass<SyrMetod<cl_float> > ec;
 304    ec.error(clblasInsufficientMemMatA);
 305}
 306
 307TEST(ERROR, InvalidDevicesyr) {
 308    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 309    if (!base->isDevSupportDoublePrecision()) {
 310    ErrorClass<SyrMetod<cl_double> > ec;
 311        ec.error(CL_INVALID_DEVICE);
 312    }
 313}
 314#endif
 315
 316#ifdef DO_SPR
 317TEST(ERROR, InvalidCommandQueuespr) {
 318    ErrorClass<SprMetod<cl_float> > ec;
 319    ec.error(CL_INVALID_COMMAND_QUEUE);
 320}
 321
 322TEST(ERROR, InvalidEventWaitListspr) {
 323    ErrorClass<SprMetod<cl_float> > ec;
 324    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 325}
 326
 327TEST(ERROR, InvalidMemObjectspr) {
 328    ErrorClass<SprMetod<cl_float> > ec;
 329    ec.error(clblasInvalidMatA);
 330}
 331TEST(ERROR, InvalidValuespr) {
 332    ErrorClass<SprMetod<cl_float> > ec;
 333    ec.error(clblasInsufficientMemMatA);
 334}
 335
 336TEST(ERROR, InvalidDevicespr) {
 337    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 338    if (!base->isDevSupportDoublePrecision()) {
 339    ErrorClass<SprMetod<cl_double> > ec;
 340        ec.error(CL_INVALID_DEVICE);
 341    }
 342}
 343#endif
 344
 345
 346#ifdef DO_SYR2
 347TEST(ERROR, InvalidCommandQueuesyr2) {
 348    ErrorClass<Syr2Metod<cl_float> > ec;
 349    ec.error(CL_INVALID_COMMAND_QUEUE);
 350}
 351
 352TEST(ERROR, InvalidEventWaitListsyr2) {
 353    ErrorClass<Syr2Metod<cl_float> > ec;
 354    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 355}
 356
 357TEST(ERROR, InvalidMemObjectsyr2) {
 358    ErrorClass<Syr2Metod<cl_float> > ec;
 359    ec.error(clblasInvalidMatA);
 360}
 361TEST(ERROR, InvalidValuesyr2) {
 362    ErrorClass<Syr2Metod<cl_float> > ec;
 363    ec.error(clblasInsufficientMemMatA);
 364}
 365
 366TEST(ERROR, InvalidDevicesyr2) {
 367    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 368    if (!base->isDevSupportDoublePrecision()) {
 369    ErrorClass<Syr2Metod<cl_double> > ec;
 370        ec.error(CL_INVALID_DEVICE);
 371    }
 372}
 373#endif
 374
 375#ifdef DO_GER
 376TEST(ERROR, InvalidCommandQueueger) {
 377    ErrorClass<GerMetod<FloatComplex> > ec;
 378    ec.error(CL_INVALID_COMMAND_QUEUE);
 379}
 380
 381TEST(ERROR, InvalidEventWaitListger) {
 382    ErrorClass<GerMetod<FloatComplex> > ec;
 383    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 384}
 385
 386TEST(ERROR, InvalidMemObjectger) {
 387    ErrorClass<GerMetod<FloatComplex> > ec;
 388    ec.error(clblasInvalidMatA);
 389}
 390TEST(ERROR, InvalidValueger) {
 391    ErrorClass<GerMetod<FloatComplex> > ec;
 392    ec.error(clblasInsufficientMemMatA);
 393}
 394
 395TEST(ERROR, InvalidDeviceger) {
 396    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 397    if (!base->isDevSupportDoublePrecision()) {
 398        ErrorClass<GerMetod<cl_double> > ec;
 399        ec.error(CL_INVALID_DEVICE);
 400    }
 401}
 402#endif
 403
 404#ifdef DO_GERC
 405TEST(ERROR, InvalidCommandQueuegerc) {
 406    ErrorClass<GercMetod<FloatComplex> > ec;
 407    ec.error(CL_INVALID_COMMAND_QUEUE);
 408}
 409
 410TEST(ERROR, InvalidEventWaitListgerc) {
 411    ErrorClass<GercMetod<FloatComplex> > ec;
 412    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 413}
 414
 415TEST(ERROR, InvalidMemObjectgerc) {
 416    ErrorClass<GercMetod<FloatComplex> > ec;
 417    ec.error(clblasInvalidMatA);
 418}
 419TEST(ERROR, InvalidValuegerc) {
 420    ErrorClass<GercMetod<FloatComplex> > ec;
 421    ec.error(clblasInsufficientMemMatA);
 422}
 423
 424TEST(ERROR, InvalidDevicegerc) {
 425    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 426    if (!base->isDevSupportDoublePrecision()) {
 427        ErrorClass<GercMetod<DoubleComplex> > ec;
 428        ec.error(CL_INVALID_DEVICE);
 429    }
 430}
 431#endif
 432
 433
 434#ifdef DO_HER
 435TEST(ERROR, InvalidCommandQueueher) {
 436    ErrorClass<HerMetod<FloatComplex> > ec;
 437    ec.error(CL_INVALID_COMMAND_QUEUE);
 438}
 439
 440TEST(ERROR, InvalidEventWaitListher) {
 441    ErrorClass<HerMetod<FloatComplex> > ec;
 442    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 443}
 444
 445TEST(ERROR, InvalidMemObjecther) {
 446    ErrorClass<HerMetod<FloatComplex> > ec;
 447    ec.error(clblasInvalidMatA);
 448}
 449
 450TEST(ERROR, InvalidValueher) {
 451
 452    ErrorClass<HerMetod<DoubleComplex> > ec;
 453    ec.error(clblasInsufficientMemMatA);
 454}
 455
 456TEST(ERROR, InvalidDeviceher) {
 457    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 458    if (!base->isDevSupportDoublePrecision()) {
 459    ErrorClass<HerMetod<DoubleComplex> > ec;
 460        ec.error(CL_INVALID_DEVICE);
 461    }
 462}
 463#endif
 464
 465#ifdef DO_HER2
 466TEST(ERROR, InvalidCommandQueueher2) {
 467    ErrorClass<Her2Metod<FloatComplex> > ec;
 468    ec.error(CL_INVALID_COMMAND_QUEUE);
 469}
 470
 471TEST(ERROR, InvalidEventWaitListher2) {
 472    ErrorClass<Her2Metod<FloatComplex> > ec;
 473    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 474}
 475
 476TEST(ERROR, InvalidMemObjecther2) {
 477    ErrorClass<Her2Metod<FloatComplex> > ec;
 478    ec.error(clblasInvalidMatA);
 479}
 480
 481TEST(ERROR, InvalidValueher2) {
 482
 483    ErrorClass<Her2Metod<DoubleComplex> > ec;
 484    ec.error(clblasInsufficientMemMatA);
 485}
 486
 487TEST(ERROR, InvalidDeviceher2) {
 488    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 489    if (!base->isDevSupportDoublePrecision()) {
 490    ErrorClass<Her2Metod<DoubleComplex> > ec;
 491        ec.error(CL_INVALID_DEVICE);
 492    }
 493}
 494#endif
 495
 496#ifdef DO_HEMM
 497TEST(ERROR, InvalidCommandQueuehemm) {
 498    ErrorClass<HemmMetod<FloatComplex> > ec;
 499    ec.error(CL_INVALID_COMMAND_QUEUE);
 500}
 501
 502TEST(ERROR, InvalidEventWaitListhemm) {
 503    ErrorClass<HemmMetod<FloatComplex> > ec;
 504    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 505}
 506
 507TEST(ERROR, InvalidMemObjecthemm) {
 508    ErrorClass<HemmMetod<FloatComplex> > ec;
 509    ec.error(clblasInvalidMatA);
 510}
 511
 512TEST(ERROR, InvalidValuehemm) {
 513
 514    ErrorClass<HemmMetod<DoubleComplex> > ec;
 515    ec.error(clblasInsufficientMemMatB);
 516}
 517
 518TEST(ERROR, InvalidDevicehemm) {
 519    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 520    if (!base->isDevSupportDoublePrecision()) {
 521    ErrorClass<HemmMetod<DoubleComplex> > ec;
 522        ec.error(CL_INVALID_DEVICE);
 523    }
 524}
 525#endif
 526
 527#ifdef DO_HEMV
 528TEST(ERROR, InvalidCommandQueuehemv) {
 529    ErrorClass<HemvMetod<FloatComplex> > ec;
 530    ec.error(CL_INVALID_COMMAND_QUEUE);
 531}
 532
 533TEST(ERROR, InvalidEventWaitListhemv) {
 534    ErrorClass<HemvMetod<FloatComplex> > ec;
 535    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 536}
 537
 538TEST(ERROR, InvalidMemObjecthemv) {
 539    ErrorClass<HemvMetod<FloatComplex> > ec;
 540    ec.error(clblasInvalidMatA);
 541}
 542
 543TEST(ERROR, InvalidValuehemv) {
 544
 545    ErrorClass<HemvMetod<DoubleComplex> > ec;
 546    ec.error(clblasInsufficientMemMatA);
 547}
 548
 549TEST(ERROR, InvalidDevicehemv) {
 550    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 551    if (!base->isDevSupportDoublePrecision()) {
 552    ErrorClass<HemvMetod<DoubleComplex> > ec;
 553        ec.error(CL_INVALID_DEVICE);
 554    }
 555}
 556#endif
 557
 558#ifdef DO_HERK
 559TEST(ERROR, InvalidCommandQueueherk) {
 560    ErrorClass<HerkMetod<FloatComplex> > ec;
 561    ec.error(CL_INVALID_COMMAND_QUEUE);
 562}
 563
 564TEST(ERROR, InvalidEventWaitListherk) {
 565    ErrorClass<HerkMetod<FloatComplex> > ec;
 566    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 567}
 568
 569TEST(ERROR, InvalidMemObjectherk) {
 570    ErrorClass<HerkMetod<FloatComplex> > ec;
 571    ec.error(clblasInvalidMatA);
 572}
 573
 574TEST(ERROR, InvalidValueherk) {
 575    ErrorClass<HerkMetod<DoubleComplex> > ec;
 576    ec.error(clblasInsufficientMemMatA);
 577}
 578
 579TEST(ERROR, InvalidDeviceherk) {
 580    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 581    if (!base->isDevSupportDoublePrecision()) {
 582    ErrorClass<HerkMetod<DoubleComplex> > ec;
 583        ec.error(CL_INVALID_DEVICE);
 584    }
 585}
 586#endif
 587
 588
 589#ifdef DO_HPMV
 590
 591TEST(ERROR, InvalidCommandQueuehpmv) {
 592    ErrorClass<HpmvMetod<FloatComplex> > ec;
 593    ec.error(CL_INVALID_COMMAND_QUEUE);
 594}
 595
 596TEST(ERROR, InvalidEventWaitListhpmv) {
 597    ErrorClass<HpmvMetod<FloatComplex> > ec;
 598    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 599}
 600
 601TEST(ERROR, InvalidMemObjecthpmv) {
 602    ErrorClass<HpmvMetod<FloatComplex> > ec;
 603    ec.error(clblasInvalidMatA);
 604}
 605
 606TEST(ERROR, InvalidValuehpmv) {
 607
 608    ErrorClass<HpmvMetod<DoubleComplex> > ec;
 609    ec.error(clblasInsufficientMemMatA);
 610}
 611
 612TEST(ERROR, InvalidDevicehpmv) {
 613    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 614    if (!base->isDevSupportDoublePrecision()) {
 615    ErrorClass<HpmvMetod<DoubleComplex> > ec;
 616        ec.error(CL_INVALID_DEVICE);
 617    }
 618}
 619#endif
 620
 621
 622#ifdef DO_SPMV
 623TEST(ERROR, InvalidCommandQueuespmv) {
 624    ErrorClass<SpmvMetod<cl_float> > ec;
 625    ec.error(CL_INVALID_COMMAND_QUEUE);
 626}
 627
 628TEST(ERROR, InvalidEventWaitListspmv) {
 629    ErrorClass<SpmvMetod<cl_float> > ec;
 630    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 631}
 632
 633TEST(ERROR, InvalidMemObjectspmv) {
 634    ErrorClass<SpmvMetod<cl_float> > ec;
 635    ec.error(clblasInvalidMatA);
 636}
 637
 638TEST(ERROR, InvalidValuespmv) {
 639
 640    ErrorClass<SpmvMetod<cl_double> > ec;
 641    ec.error(clblasInsufficientMemMatA);
 642}
 643
 644TEST(ERROR, InvalidDevicespmv) {
 645    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 646    if (!base->isDevSupportDoublePrecision()) {
 647    ErrorClass<SpmvMetod<cl_double> > ec;
 648        ec.error(CL_INVALID_DEVICE);
 649    }
 650}
 651#endif
 652
 653#ifdef DO_SPR2
 654TEST(ERROR, InvalidCommandQueuespr2) {
 655    ErrorClass<Spr2Metod<cl_float> > ec;
 656    ec.error(CL_INVALID_COMMAND_QUEUE);
 657}
 658
 659TEST(ERROR, InvalidEventWaitListspr2) {
 660    ErrorClass<Spr2Metod<cl_float> > ec;
 661    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 662}
 663
 664TEST(ERROR, InvalidMemObjectspr2) {
 665    ErrorClass<Spr2Metod<cl_float> > ec;
 666    ec.error(clblasInvalidMatA);
 667}
 668TEST(ERROR, InvalidValuespr2) {
 669    ErrorClass<Spr2Metod<cl_float> > ec;
 670    ec.error(clblasInsufficientMemMatA);
 671}
 672
 673TEST(ERROR, InvalidDevicespr2) {
 674    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 675    if (!base->isDevSupportDoublePrecision()) {
 676    ErrorClass<Spr2Metod<cl_double> > ec;
 677        ec.error(CL_INVALID_DEVICE);
 678    }
 679}
 680#endif
 681
 682
 683#ifdef DO_HPR
 684TEST(ERROR, InvalidCommandQueuehpr) {
 685    ErrorClass<HprMetod<FloatComplex> > ec;
 686    ec.error(CL_INVALID_COMMAND_QUEUE);
 687}
 688
 689TEST(ERROR, InvalidEventWaitListhpr) {
 690    ErrorClass<HprMetod<FloatComplex> > ec;
 691    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 692}
 693
 694TEST(ERROR, InvalidMemObjecthpr) {
 695    ErrorClass<HprMetod<FloatComplex> > ec;
 696    ec.error(clblasInvalidMatA);
 697}
 698
 699TEST(ERROR, InvalidValuehpr) {
 700
 701    ErrorClass<HprMetod<DoubleComplex> > ec;
 702    ec.error(clblasInsufficientMemMatA);
 703}
 704
 705TEST(ERROR, InvalidDevicehpr) {
 706    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 707    if (!base->isDevSupportDoublePrecision()) {
 708    ErrorClass<HprMetod<DoubleComplex> > ec;
 709        ec.error(CL_INVALID_DEVICE);
 710    }
 711}
 712#endif
 713
 714#ifdef DO_HPR2
 715TEST(ERROR, InvalidCommandQueuehpr2) {
 716    ErrorClass<Hpr2Metod<FloatComplex> > ec;
 717    ec.error(CL_INVALID_COMMAND_QUEUE);
 718}
 719
 720TEST(ERROR, InvalidEventWaitListhpr2) {
 721    ErrorClass<Hpr2Metod<FloatComplex> > ec;
 722    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 723}
 724
 725TEST(ERROR, InvalidMemObjecthpr2) {
 726    ErrorClass<Hpr2Metod<FloatComplex> > ec;
 727    ec.error(clblasInvalidMatA);
 728}
 729
 730TEST(ERROR, InvalidValuehpr2) {
 731
 732    ErrorClass<Hpr2Metod<DoubleComplex> > ec;
 733    ec.error(clblasInsufficientMemMatA);
 734}
 735
 736TEST(ERROR, InvalidDevicehpr2) {
 737    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 738    if (!base->isDevSupportDoublePrecision()) {
 739    ErrorClass<Hpr2Metod<DoubleComplex> > ec;
 740        ec.error(CL_INVALID_DEVICE);
 741    }
 742}
 743#endif
 744
 745
 746#ifdef DO_GBMV
 747TEST(ERROR, InvalidCommandQueueGBMV) {
 748    ErrorClass<GbmvMetod<cl_float> > ec;
 749    ec.error(CL_INVALID_COMMAND_QUEUE);
 750}
 751
 752TEST(ERROR, InvalidEventWaitListGBMV) {
 753    ErrorClass<GbmvMetod<cl_float> > ec;
 754    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 755}
 756
 757TEST(ERROR, InvalidMemObjectGBMV) {
 758    ErrorClass<GbmvMetod<cl_float> > ec;
 759    ec.error(clblasInvalidMatA);
 760}
 761
 762TEST(ERROR, InvalidValueGBMV) {
 763    ErrorClass<GbmvMetod<cl_double> > ec;
 764    ec.error(clblasInsufficientMemMatA);
 765}
 766
 767TEST(ERROR, InvalidDeviceGBMV) {
 768    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 769    if (!base->isDevSupportDoublePrecision()) {
 770    ErrorClass<GbmvMetod<cl_double> > ec;
 771        ec.error(CL_INVALID_DEVICE);
 772    }
 773}
 774#endif
 775
 776#ifdef DO_SBMV
 777TEST(ERROR, InvalidCommandQueuesbmv) {
 778    ErrorClass<SbmvMetod<cl_float> > ec;
 779    ec.error(CL_INVALID_COMMAND_QUEUE);
 780}
 781
 782TEST(ERROR, InvalidEventWaitListsbmv) {
 783    ErrorClass<SbmvMetod<cl_float> > ec;
 784    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 785}
 786
 787TEST(ERROR, InvalidMemObjectsbmv) {
 788    ErrorClass<SbmvMetod<cl_float> > ec;
 789    ec.error(clblasInvalidMatA);
 790}
 791
 792TEST(ERROR, InvalidValuesbmv) {
 793    ErrorClass<SbmvMetod<cl_float> > ec;
 794    ec.error(clblasInsufficientMemMatA);
 795}
 796
 797TEST(ERROR, InvalidDevicesbmv) {
 798    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 799    if (!base->isDevSupportDoublePrecision()) {
 800    ErrorClass<SbmvMetod<cl_double> > ec;
 801        ec.error(CL_INVALID_DEVICE);
 802    }
 803}
 804#endif
 805
 806#ifdef DO_HBMV
 807TEST(ERROR, InvalidCommandQueuehbmv) {
 808    ErrorClass<HbmvMetod<FloatComplex> > ec;
 809    ec.error(CL_INVALID_COMMAND_QUEUE);
 810}
 811
 812TEST(ERROR, InvalidEventWaitListhbmv) {
 813    ErrorClass<HbmvMetod<FloatComplex> > ec;
 814    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 815}
 816
 817TEST(ERROR, InvalidMemObjecthbmv) {
 818    ErrorClass<HbmvMetod<FloatComplex> > ec;
 819    ec.error(clblasInvalidMatA);
 820}
 821
 822TEST(ERROR, InvalidValuehbmv) {
 823    ErrorClass<HbmvMetod<FloatComplex> > ec;
 824    ec.error(clblasInsufficientMemMatA);
 825}
 826
 827TEST(ERROR, InvalidDevicehbmv) {
 828    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 829    if (!base->isDevSupportDoublePrecision()) {
 830    ErrorClass<HbmvMetod<DoubleComplex> > ec;
 831        ec.error(CL_INVALID_DEVICE);
 832    }
 833}
 834#endif
 835
 836
 837#ifdef DO_TBMV
 838TEST(ERROR, InvalidCommandQueueTBMV) {
 839    ErrorClass<TbmvMetod<cl_float> > ec;
 840    ec.error(CL_INVALID_COMMAND_QUEUE);
 841}
 842
 843TEST(ERROR, InvalidEventWaitListTBMV) {
 844    ErrorClass<TbmvMetod<cl_float> > ec;
 845    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 846}
 847
 848TEST(ERROR, InvalidMemObjectTBMV) {
 849    ErrorClass<TbmvMetod<cl_float> > ec;
 850    ec.error(clblasInvalidMatA);
 851}
 852
 853TEST(ERROR, InvalidValueTBMV) {
 854
 855    ErrorClass<TbmvMetod<cl_double> > ec;
 856    ec.error(clblasInsufficientMemMatA);
 857}
 858
 859TEST(ERROR, InvalidDeviceTBMV) {
 860    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 861    if (!base->isDevSupportDoublePrecision()) {
 862    ErrorClass<TbmvMetod<cl_double> > ec;
 863        ec.error(CL_INVALID_DEVICE);
 864    }
 865}
 866#endif
 867
 868#ifdef DO_TBSV
 869TEST(ERROR, InvalidCommandQueueTBSV) {
 870    ErrorClass<TbsvMetod<cl_float> > ec;
 871    ec.error(CL_INVALID_COMMAND_QUEUE);
 872}
 873
 874TEST(ERROR, InvalidEventWaitListTBSV) {
 875    ErrorClass<TbsvMetod<cl_float> > ec;
 876    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 877}
 878
 879TEST(ERROR, InvalidMemObjectTBSV) {
 880    ErrorClass<TbsvMetod<cl_float> > ec;
 881    ec.error(clblasInvalidMatA);
 882}
 883
 884TEST(ERROR, InvalidValueTBSV) {
 885
 886    ErrorClass<TbsvMetod<cl_double> > ec;
 887    ec.error(clblasInsufficientMemVecX);
 888}
 889
 890TEST(ERROR, InvalidDeviceTBSV) {
 891    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 892    if (!base->isDevSupportDoublePrecision()) {
 893    ErrorClass<TbsvMetod<cl_double> > ec;
 894        ec.error(CL_INVALID_DEVICE);
 895    }
 896}
 897#endif
 898
 899#ifdef DO_HER2K
 900TEST(ERROR, InvalidCommandQueueher2k) {
 901    ErrorClass<Her2kMetod<FloatComplex> > ec;
 902    ec.error(CL_INVALID_COMMAND_QUEUE);
 903}
 904
 905TEST(ERROR, InvalidEventWaitListher2k) {
 906    ErrorClass<Her2kMetod<FloatComplex> > ec;
 907    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 908}
 909
 910TEST(ERROR, InvalidMemObjecther2k) {
 911    ErrorClass<Her2kMetod<FloatComplex> > ec;
 912    ec.error(clblasInvalidMatA);
 913}
 914
 915TEST(ERROR, InvalidValueher2k) {
 916    ErrorClass<Her2kMetod<DoubleComplex> > ec;
 917    ec.error(clblasInsufficientMemMatA);
 918}
 919
 920TEST(ERROR, InvalidDeviceher2k) {
 921    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 922    if (!base->isDevSupportDoublePrecision()) {
 923    ErrorClass<Her2kMetod<DoubleComplex> > ec;
 924        ec.error(CL_INVALID_DEVICE);
 925    }
 926}
 927#endif
 928
 929#ifdef DO_SCAL
 930TEST(ERROR, InvalidCommandQueuescal) {
 931    ErrorClass<ScalMetod<float> > ec;
 932    ec.error(CL_INVALID_COMMAND_QUEUE);
 933}
 934
 935TEST(ERROR, InvalidEventWaitListscal) {
 936    ErrorClass<ScalMetod<double> > ec;
 937    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 938}
 939
 940TEST(ERROR, InvalidMemObjectscal) {
 941    ErrorClass<ScalMetod<FloatComplex> > ec;
 942    ec.error(clblasInvalidVecX);
 943}
 944
 945TEST(ERROR, InvalidValuescal) {
 946    ErrorClass<ScalMetod<DoubleComplex> > ec;
 947    ec.error(clblasInsufficientMemVecX);
 948}
 949
 950TEST(ERROR, InvalidDevicescal) {
 951    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 952    if (!base->isDevSupportDoublePrecision()) {
 953    ErrorClass<ScalMetod<DoubleComplex> > ec;
 954        ec.error(CL_INVALID_DEVICE);
 955    }
 956}
 957#endif
 958
 959#ifdef DO_SSCAL
 960TEST(ERROR, InvalidCommandQueuesscal) {
 961    ErrorClass<SscalMetod<FloatComplex> > ec;
 962    ec.error(CL_INVALID_COMMAND_QUEUE);
 963}
 964
 965TEST(ERROR, InvalidEventWaitListsscal) {
 966    ErrorClass<SscalMetod<DoubleComplex> > ec;
 967    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 968}
 969
 970TEST(ERROR, InvalidMemObjectsscal) {
 971    ErrorClass<SscalMetod<FloatComplex> > ec;
 972    ec.error(clblasInvalidVecX);
 973}
 974
 975TEST(ERROR, InvalidValuesscal) {
 976    ErrorClass<SscalMetod<DoubleComplex> > ec;
 977    ec.error(clblasInsufficientMemVecX);
 978}
 979
 980TEST(ERROR, InvalidDevicesscal) {
 981    clMath::BlasBase* base = clMath::BlasBase::getInstance();
 982    if (!base->isDevSupportDoublePrecision()) {
 983    ErrorClass<SscalMetod<DoubleComplex> > ec;
 984        ec.error(CL_INVALID_DEVICE);
 985    }
 986}
 987#endif
 988
 989#ifdef DO_SWAP
 990TEST(ERROR, InvalidCommandQueueswap) {
 991    ErrorClass<SwapMetod<float> > ec;
 992    ec.error(CL_INVALID_COMMAND_QUEUE);
 993}
 994
 995TEST(ERROR, InvalidEventWaitListswap) {
 996    ErrorClass<SwapMetod<double> > ec;
 997    ec.error(CL_INVALID_EVENT_WAIT_LIST);
 998}
 999
1000TEST(ERROR, InvalidMemObjectswap) {
1001    ErrorClass<SwapMetod<FloatComplex> > ec;
1002    ec.error(clblasInvalidVecX);
1003}
1004
1005TEST(ERROR, InvalidValueswap) {
1006    ErrorClass<SwapMetod<DoubleComplex> > ec;
1007    ec.error(clblasInsufficientMemVecX);
1008}
1009
1010TEST(ERROR, InvalidDeviceswap) {
1011    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1012    if (!base->isDevSupportDoublePrecision()) {
1013    ErrorClass<SwapMetod<DoubleComplex> > ec;
1014        ec.error(CL_INVALID_DEVICE);
1015    }
1016}
1017#endif
1018
1019#ifdef DO_COPY
1020TEST(ERROR, InvalidCommandQueuecopy) {
1021    ErrorClass<CopyMetod<float> > ec;
1022    ec.error(CL_INVALID_COMMAND_QUEUE);
1023}
1024
1025TEST(ERROR, InvalidEventWaitListcopy) {
1026    ErrorClass<CopyMetod<double> > ec;
1027    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1028}
1029
1030TEST(ERROR, InvalidMemObjectcopy) {
1031    ErrorClass<CopyMetod<FloatComplex> > ec;
1032    ec.error(clblasInvalidVecX);
1033}
1034
1035TEST(ERROR, InvalidValuecopy) {
1036    ErrorClass<CopyMetod<DoubleComplex> > ec;
1037    ec.error(clblasInsufficientMemVecX);
1038}
1039
1040TEST(ERROR, InvalidDevicecopy) {
1041    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1042    if (!base->isDevSupportDoublePrecision()) {
1043    ErrorClass<CopyMetod<DoubleComplex> > ec;
1044        ec.error(CL_INVALID_DEVICE);
1045    }
1046}
1047#endif
1048
1049
1050#ifdef DO_AXPY
1051TEST(ERROR, InvalidCommandQueueaxpy) {
1052    ErrorClass<AxpyMetod<float> > ec;
1053    ec.error(CL_INVALID_COMMAND_QUEUE);
1054}
1055
1056TEST(ERROR, InvalidEventWaitListaxpy) {
1057    ErrorClass<AxpyMetod<double> > ec;
1058    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1059}
1060
1061TEST(ERROR, InvalidMemObjectaxpy) {
1062    ErrorClass<AxpyMetod<FloatComplex> > ec;
1063    ec.error(clblasInvalidVecX);
1064}
1065
1066TEST(ERROR, InvalidValueaxpy) {
1067    ErrorClass<AxpyMetod<DoubleComplex> > ec;
1068    ec.error(clblasInsufficientMemVecX);
1069}
1070
1071TEST(ERROR, InvalidDeviceaxpy) {
1072    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1073    if (!base->isDevSupportDoublePrecision()) {
1074    ErrorClass<AxpyMetod<DoubleComplex> > ec;
1075        ec.error(CL_INVALID_DEVICE);
1076    }
1077}
1078#endif
1079
1080//DOT
1081#ifdef DO_DOT
1082TEST(ERROR, InvalidCommandQueuedot) {
1083    ErrorClass<DotMetod<cl_float> > ec;
1084    ec.error(CL_INVALID_COMMAND_QUEUE);
1085}
1086
1087TEST(ERROR, InvalidEventWaitListdot) {
1088    ErrorClass<DotMetod<cl_double> > ec;
1089    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1090}
1091
1092TEST(ERROR, InvalidMemObjectdot) {
1093    ErrorClass<DotMetod<FloatComplex> > ec;
1094    ec.error(clblasInvalidVecX);
1095}
1096TEST(ERROR, InvalidValuedot) {
1097    ErrorClass<DotMetod<DoubleComplex> > ec;
1098    ec.error(clblasInsufficientMemVecX);
1099}
1100
1101TEST(ERROR, InvalidDevicedot) {
1102    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1103    if (!base->isDevSupportDoublePrecision()) {
1104    ErrorClass<DotMetod<DoubleComplex> > ec;
1105        ec.error(CL_INVALID_DEVICE);
1106    }
1107}
1108#endif
1109
1110#ifdef DO_ASUM
1111TEST(ERROR, InvalidCommandQueueasum) {
1112    ErrorClass<AsumMetod<cl_float> > ec;
1113    ec.error(CL_INVALID_COMMAND_QUEUE);
1114}
1115
1116TEST(ERROR, InvalidEventWaitListasum) {
1117    ErrorClass<AsumMetod<cl_double> > ec;
1118    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1119}
1120
1121TEST(ERROR, InvalidMemObjectasum) {
1122    ErrorClass<AsumMetod<FloatComplex> > ec;
1123    ec.error(clblasInvalidVecX);
1124}
1125TEST(ERROR, InvalidValueasum) {
1126    ErrorClass<AsumMetod<DoubleComplex> > ec;
1127    ec.error(clblasInsufficientMemVecX);
1128}
1129
1130TEST(ERROR, InvalidDeviceasum) {
1131    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1132    if (!base->isDevSupportDoublePrecision()) {
1133    ErrorClass<AsumMetod<DoubleComplex> > ec;
1134        ec.error(CL_INVALID_DEVICE);
1135    }
1136}
1137#endif
1138
1139#ifdef DO_iAMAX
1140TEST(ERROR, InvalidCommandQueueiamax) {
1141    ErrorClass<iAmaxMetod<cl_float> > ec;
1142    ec.error(CL_INVALID_COMMAND_QUEUE);
1143}
1144
1145TEST(ERROR, InvalidEventWaitListiamax) {
1146    ErrorClass<iAmaxMetod<cl_double> > ec;
1147    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1148}
1149
1150TEST(ERROR, InvalidMemObjectiamax) {
1151    ErrorClass<iAmaxMetod<FloatComplex> > ec;
1152    ec.error(clblasInvalidVecX);
1153}
1154TEST(ERROR, InvalidValueiamax) {
1155    ErrorClass<iAmaxMetod<DoubleComplex> > ec;
1156    ec.error(clblasInsufficientMemVecX);
1157}
1158
1159TEST(ERROR, InvalidDeviceiamax) {
1160    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1161    if (!base->isDevSupportDoublePrecision()) {
1162    ErrorClass<iAmaxMetod<DoubleComplex> > ec;
1163        ec.error(CL_INVALID_DEVICE);
1164    }
1165}
1166#endif
1167
1168//DOTC
1169#ifdef DO_DOTC
1170TEST(ERROR, InvalidCommandQueuedotc) {
1171    ErrorClass<DotcMetod<FloatComplex> > ec;
1172    ec.error(CL_INVALID_COMMAND_QUEUE);
1173}
1174
1175TEST(ERROR, InvalidEventWaitListdotc) {
1176    ErrorClass<DotcMetod<DoubleComplex> > ec;
1177    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1178}
1179
1180TEST(ERROR, InvalidMemObjectdotc) {
1181    ErrorClass<DotcMetod<FloatComplex> > ec;
1182    ec.error(clblasInvalidVecX);
1183}
1184TEST(ERROR, InvalidValuedotc) {
1185    ErrorClass<DotcMetod<DoubleComplex> > ec;
1186    ec.error(clblasInsufficientMemVecX);
1187}
1188
1189TEST(ERROR, InvalidDevicedotc) {
1190    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1191    if (!base->isDevSupportDoublePrecision()) {
1192    ErrorClass<DotMetod<DoubleComplex> > ec;
1193        ec.error(CL_INVALID_DEVICE);
1194    }
1195}
1196#endif
1197
1198
1199#ifdef DO_ROTG
1200TEST(ERROR, InvalidCommandQueuerotg) {
1201    ErrorClass<RotgMetod<float> > ec;
1202    ec.error(CL_INVALID_COMMAND_QUEUE);
1203}
1204
1205TEST(ERROR, InvalidEventWaitListrotg) {
1206    ErrorClass<RotgMetod<double> > ec;
1207    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1208}
1209
1210TEST(ERROR, InvalidMemObjectrotg) {
1211    ErrorClass<RotgMetod<FloatComplex> > ec;
1212    ec.error(clblasInvalidVecX);
1213}
1214
1215/*  Skipping Invalid value- because rotg doesn't depend on parameter N,
1216                            So even passing an invalid N doesn't matter
1217TEST(ERROR, InvalidValuerotg) {
1218    ErrorClass<RotgMetod<DoubleComplex> > ec;
1219    ec.error(clblasInsufficientMemVecX);
1220}
1221*/
1222
1223TEST(ERROR, InvalidDevicerotg) {
1224    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1225    if (!base->isDevSupportDoublePrecision()) {
1226    ErrorClass<RotgMetod<DoubleComplex> > ec;
1227        ec.error(CL_INVALID_DEVICE);
1228    }
1229}
1230#endif
1231
1232#ifdef DO_ROTM
1233TEST(ERROR, InvalidCommandQueuerotm) {
1234    ErrorClass<RotmMetod<float> > ec;
1235    ec.error(CL_INVALID_COMMAND_QUEUE);
1236}
1237
1238TEST(ERROR, InvalidEventWaitListrotm) {
1239    ErrorClass<RotmMetod<double> > ec;
1240    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1241}
1242
1243TEST(ERROR, InvalidMemObjectrotm) {
1244    ErrorClass<RotmMetod<float> > ec;
1245    ec.error(clblasInvalidVecX);
1246}
1247
1248TEST(ERROR, InvalidValuerotm) {
1249    ErrorClass<RotmMetod<double> > ec;
1250    ec.error(clblasInsufficientMemVecX);
1251}
1252
1253TEST(ERROR, InvalidDevicerotm) {
1254    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1255    if (!base->isDevSupportDoublePrecision()) {
1256    ErrorClass<RotmMetod<double> > ec;
1257        ec.error(CL_INVALID_DEVICE);
1258    }
1259}
1260#endif
1261
1262#ifdef DO_ROT
1263TEST(ERROR, InvalidCommandQueuerot) {
1264    ErrorClass<RotMetod<float> > ec;
1265    ec.error(CL_INVALID_COMMAND_QUEUE);
1266}
1267
1268TEST(ERROR, InvalidEventWaitListrot) {
1269    ErrorClass<RotMetod<double> > ec;
1270    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1271}
1272
1273TEST(ERROR, InvalidMemObjectrot) {
1274    ErrorClass<RotMetod<FloatComplex> > ec;
1275    ec.error(clblasInvalidVecX);
1276}
1277
1278TEST(ERROR, InvalidValuerot) {
1279    ErrorClass<RotMetod<DoubleComplex> > ec;
1280    ec.error(clblasInsufficientMemVecX);
1281}
1282
1283TEST(ERROR, InvalidDevicerot) {
1284    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1285    if (!base->isDevSupportDoublePrecision()) {
1286    ErrorClass<RotMetod<DoubleComplex> > ec;
1287        ec.error(CL_INVALID_DEVICE);
1288    }
1289}
1290#endif
1291
1292#ifdef DO_ROTMG
1293TEST(ERROR, InvalidCommandQueuerotmg) {
1294    ErrorClass<RotmgMetod<float> > ec;
1295    ec.error(CL_INVALID_COMMAND_QUEUE);
1296}
1297
1298TEST(ERROR, InvalidEventWaitListrotmg) {
1299    ErrorClass<RotmgMetod<double> > ec;
1300    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1301}
1302
1303TEST(ERROR, InvalidMemObjectrotmg) {
1304    ErrorClass<RotmgMetod<float> > ec;
1305    ec.error(clblasInvalidVecX);
1306}
1307
1308/*  Skipping Invalid value- because rotg doesn't depend on parameter N,
1309                            So even passing an invalid N doesn't matter
1310TEST(ERROR, InvalidValuerotmg) {
1311    ErrorClass<RotmgMetod<double> > ec;
1312    ec.error(clblasInsufficientMemVecX);
1313}
1314*/
1315
1316TEST(ERROR, InvalidDevicerotmg) {
1317    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1318    if (!base->isDevSupportDoublePrecision()) {
1319    ErrorClass<RotmgMetod<double> > ec;
1320        ec.error(CL_INVALID_DEVICE);
1321    }
1322}
1323#endif
1324
1325#ifdef DO_NRM2
1326TEST(ERROR, InvalidCommandQueuenrm2) {
1327    ErrorClass<Nrm2Metod<cl_float> > ec;
1328    ec.error(CL_INVALID_COMMAND_QUEUE);
1329}
1330
1331TEST(ERROR, InvalidEventWaitListnrm2) {
1332    ErrorClass<Nrm2Metod<cl_double> > ec;
1333    ec.error(CL_INVALID_EVENT_WAIT_LIST);
1334}
1335
1336TEST(ERROR, InvalidMemObjectnrm2) {
1337    ErrorClass<Nrm2Metod<FloatComplex> > ec;
1338    ec.error(clblasInvalidVecX);
1339}
1340TEST(ERROR, InvalidValuenrm2) {
1341    ErrorClass<Nrm2Metod<DoubleComplex> > ec;
1342    ec.error(clblasInsufficientMemVecX);
1343}
1344
1345TEST(ERROR, InvalidDevicenrm2) {
1346    clMath::BlasBase* base = clMath::BlasBase::getInstance();
1347    if (!base->isDevSupportDoublePrecision()) {
1348    ErrorClass<Nrm2Metod<DoubleComplex> > ec;
1349        ec.error(CL_INVALID_DEVICE);
1350    }
1351}
1352#endif
1353
1354