From f481a51f39a457c662a0b1b817e90341fda6ce1e Mon Sep 17 00:00:00 2001 From: Evghenii Gaburov Date: Tue, 24 Feb 2015 12:54:06 +0100 Subject: [PATCH] remove std::vector in favor of std::initializor_list in GPUTargets.h --- ptxtools/GPUTargets.h | 2 +- ptxtools/ptxcc.cpp | 4 ++-- ptxtools/ptxgen.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ptxtools/GPUTargets.h b/ptxtools/GPUTargets.h index 6197ca58..a15d4d09 100644 --- a/ptxtools/GPUTargets.h +++ b/ptxtools/GPUTargets.h @@ -36,5 +36,5 @@ met: namespace GPUTargets { - static const std::vector computeMode = {"sm_35", "sm_37"}; + static const auto computeMode = {"sm_35", "sm_37"}; } diff --git a/ptxtools/ptxcc.cpp b/ptxtools/ptxcc.cpp index 2dad25d2..49385f69 100644 --- a/ptxtools/ptxcc.cpp +++ b/ptxtools/ptxcc.cpp @@ -123,7 +123,7 @@ static void lUsage(const int ret) fprintf(stdout, " [--arch=]\t\t\t GPU target architectures:\n"); fprintf(stdout, " \t\t\t\t "); for (const auto& mode : GPUTargets::computeMode) - fprintf(stdout, "%s ", mode.c_str()); + fprintf(stdout, "%s ", mode); fprintf(stdout, "\n"); fprintf(stdout, " [-o ]\t\t\t Output file name\n"); fprintf(stdout, " [-Xnvcc=]\t Arguments to pass through to \"nvcc\"\n"); @@ -137,7 +137,7 @@ int main(int _argc, char * _argv[]) char *argv[128]; lGetAllArgs(_argc, _argv, argc, argv); - std::string arch = GPUTargets::computeMode.front(); + std::string arch = *GPUTargets::computeMode.begin(); std::string filePTX; std::string fileOBJ; std::string extString = ".ptx"; diff --git a/ptxtools/ptxgen.cpp b/ptxtools/ptxgen.cpp index 6cc2c3de..23659ea6 100644 --- a/ptxtools/ptxgen.cpp +++ b/ptxtools/ptxgen.cpp @@ -223,7 +223,7 @@ static void lUsage(const int ret) fprintf(stdout, " [--arch=]\t\t GPU target architectures:\n"); fprintf(stdout, " \t\t\t "); for (const auto& mode : GPUTargets::computeMode) - fprintf(stdout, "%s ", mode.c_str()); + fprintf(stdout, "%s ", mode); fprintf(stdout, "\n"); fprintf(stdout, " [-o ]\t\t Output file name\n"); fprintf(stdout, " [-g]\t\t Enable generation of debuggin information \n"); @@ -257,7 +257,7 @@ int main(int argc, char *argv[]) bool _useFastMath = false; bool _debug = false; bool _verbose = false; - std::string _arch = GPUTargets::computeMode.front(); + std::string _arch = *GPUTargets::computeMode.begin(); std::string fileIR, filePTX; for (int i = 1; i < argc; ++i)