From 1948d8ea42cdfa7308901955da629a073a558c56 Mon Sep 17 00:00:00 2001 From: Anton Mitrokhin Date: Thu, 16 Apr 2015 13:31:14 +0300 Subject: [PATCH] If you want to have 'CPU_None' as CPU type, than you have to have a name for it (even if that's an empty string) --- ispc.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ispc.cpp b/ispc.cpp index 6fe3579e..ea130bdc 100644 --- a/ispc.cpp +++ b/ispc.cpp @@ -245,6 +245,7 @@ public: names = std::vector >(sizeofCPUtype); compat = std::vector >(sizeofCPUtype); + names[CPU_None].push_back(""); names[CPU_Generic].push_back("generic"); @@ -353,7 +354,7 @@ public: } std::string &GetDefaultNameFromType(CPUtype type) { - Assert((type > CPU_None) && (type < sizeofCPUtype)); + Assert((type >= CPU_None) && (type < sizeofCPUtype)); return names[type][0]; } @@ -626,7 +627,7 @@ Target::Target(const char *arch, const char *cpu, const char *isa, bool pic) : this->m_hasHalf = true; this->m_hasTranscendentals = true; // It's set to false, because stdlib implementation of math functions - // is faster on MIC, than "native" implementation profided by the + // is faster on MIC, than "native" implementation provided by the // icc compiler. this->m_hasTrigonometry = false; this->m_hasGather = this->m_hasScatter = true;