Remove checks to see if system's processor matches the target the code was compiled for.

(Preparation for multi-target output.)
This commit is contained in:
Matt Pharr
2011-10-04 15:52:46 -07:00
parent 686d9975b6
commit 880cbb18cc
12 changed files with 0 additions and 448 deletions

View File

@@ -42,43 +42,10 @@
#include <algorithm>
#include <math.h>
#include "../timing.h"
#include "../cpuid.h"
#include "stencil_ispc.h"
using namespace ispc;
// Make sure that the vector ISA used during compilation is supported by
// the processor. The ISPC_TARGET_* macro is set in the ispc-generated
// header file that we include above.
static void
ensureTargetISAIsSupported() {
#if defined(ISPC_TARGET_SSE2)
bool isaSupported = CPUSupportsSSE2();
const char *target = "SSE2";
#elif defined(ISPC_TARGET_SSE4)
bool isaSupported = CPUSupportsSSE4();
const char *target = "SSE4";
#elif defined(ISPC_TARGET_AVX)
bool isaSupported = CPUSupportsAVX();
const char *target = "AVX";
#else
#error "Unknown ISPC_TARGET_* value"
#endif
if (!isaSupported) {
fprintf(stderr, "***\n*** Error: the ispc-compiled code uses the %s instruction "
"set, which isn't\n*** supported by this computer's CPU!\n", target);
fprintf(stderr, "***\n*** Please modify the "
#ifdef _MSC_VER
"MSVC project file "
#else
"Makefile "
#endif
"to select another target (e.g. sse2)\n***\n");
exit(1);
}
}
extern void loop_stencil_serial(int t0, int t1, int x0, int x1,
int y0, int y1, int z0, int z1,
int Nx, int Ny, int Nz,
@@ -100,8 +67,6 @@ void InitData(int Nx, int Ny, int Nz, float *A[2], float *vsq) {
int main() {
ensureTargetISAIsSupported();
int Nx = 256, Ny = 256, Nz = 256;
int width = 4;
float *Aserial[2], *Aispc[2];