Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove using namespace std and use std namespace explicitly #2125

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test_common/harness/parseParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <sys/stat.h>
#include <string.h>

using namespace std;

#define DEFAULT_COMPILATION_PROGRAM "cl_offline_compiler"
#define DEFAULT_SPIRV_VALIDATOR "spirv-val"

Expand Down
2 changes: 0 additions & 2 deletions test_conformance/api/test_clone_kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <string>
#include <cmath>

using namespace std;

const char *clone_kernel_test_img[] =
{
"__kernel void img_read_kernel(read_only image2d_t img, sampler_t sampler, __global int* outbuf)\n"
Expand Down
5 changes: 0 additions & 5 deletions test_conformance/api/test_queue_hint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
#include <sstream>
#include <string>

using namespace std;
/*

*/

const char *queue_hint_test_kernel[] = {
"__kernel void vec_cpy(__global int *src, __global int *dst)\n"
"{\n"
Expand Down
1 change: 0 additions & 1 deletion test_conformance/api/test_queue_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string>
#include <vector>

using namespace std;
/*
The test against cl_khr_create_command_queue extension. It validates if devices with Opencl 1.X can use clCreateCommandQueueWithPropertiesKHR function.
Based on device capabilities test will create queue with NULL properties, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE property and
Expand Down
17 changes: 8 additions & 9 deletions test_conformance/gl/test_image_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

#include <algorithm>

using namespace std;

struct image_kernel_data
{
cl_int width;
Expand Down Expand Up @@ -383,17 +381,18 @@ int test_image_methods_depth(cl_device_id device, cl_context context,
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT, &maxTextureRectangleSize);
glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &maxTextureLayers);

size = min(maxTextureSize, maxTextureRectangleSize);
size = std::min(maxTextureSize, maxTextureRectangleSize);

RandomSeed seed(gRandomSeed);

// Generate some random sizes (within reasonable ranges)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].height = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].width = random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
}

for (size_t i = 0; i < nsizes; i++)
Expand Down Expand Up @@ -440,11 +439,11 @@ int test_image_methods_multisample(cl_device_id device, cl_context context,
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
}

glEnable(GL_MULTISAMPLE);
Expand Down
6 changes: 2 additions & 4 deletions test_conformance/gl/test_images_1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,21 @@
#endif
#include <algorithm>

using namespace std;

void calc_test_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit array size according to GL device properties
GLint maxTextureSize = 4096, maxTextureBufferSize = 4096, size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, &maxTextureBufferSize);

size = min(maxTextureSize, maxTextureBufferSize);
size = std::min(maxTextureSize, maxTextureBufferSize);

RandomSeed seed(gRandomSeed);

// Generate some random sizes (within reasonable ranges)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].width = random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].height = 1;
sizes[i].depth = 1;
}
Expand Down
5 changes: 2 additions & 3 deletions test_conformance/gl/test_images_1Darray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#endif
#include <algorithm>

using namespace std;
void calc_1D_array_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit array size according to GL device properties
Expand All @@ -38,9 +37,9 @@ void calc_1D_array_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
sizes[i].depth = 1;
}
}
Expand Down
14 changes: 5 additions & 9 deletions test_conformance/gl/test_images_2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
#endif
#include <algorithm>

using namespace std;

#pragma mark -
#pragma mark _2D read tests

void calc_2D_test_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit array size according to GL device properties
Expand All @@ -37,15 +32,16 @@ void calc_2D_test_size_descriptors(sizevec_t* sizes, size_t nsizes)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT, &maxTextureRectangleSize);

size = min(maxTextureSize, maxTextureRectangleSize);
size = std::min(maxTextureSize, maxTextureRectangleSize);

RandomSeed seed(gRandomSeed);

// Generate some random sizes (within reasonable ranges)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].height = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].width = random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].depth = 1;
}
}
Expand All @@ -63,7 +59,7 @@ void calc_cube_test_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = sizes[i].height =
random_in_range(2, min(maxQubeMapSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxQubeMapSize, 1 << (i + 4)), seed);
sizes[i].depth = 1;
}
}
Expand Down
8 changes: 3 additions & 5 deletions test_conformance/gl/test_images_2Darray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#endif
#include <algorithm>

using namespace std;

void calc_2D_array_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit array size according to GL device properties
Expand All @@ -39,11 +37,11 @@ void calc_2D_array_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
}
}

Expand Down
11 changes: 3 additions & 8 deletions test_conformance/gl/test_images_3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
#endif
#include <algorithm>

using namespace std;

#pragma mark -
#pragma mark _3D read test

void calc_3D_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit array size according to GL device properties
Expand All @@ -41,11 +36,11 @@ void calc_3D_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
}
}

Expand Down
21 changes: 9 additions & 12 deletions test_conformance/gl/test_images_depth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,23 @@

#include <algorithm>

using namespace std;

#pragma mark -
#pragma mark _2D depth read tests

void calc_depth_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit texture size according to GL device properties
GLint maxTextureSize = 4096, maxTextureRectangleSize = 4096, size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT, &maxTextureRectangleSize);

size = min(maxTextureSize, maxTextureRectangleSize);
size = std::min(maxTextureSize, maxTextureRectangleSize);

RandomSeed seed(gRandomSeed);

// Generate some random sizes (within reasonable ranges)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].height = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].width = random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].depth = 1;
}
}
Expand All @@ -59,17 +55,18 @@ void calc_depth_array_size_descriptors(sizevec_t* sizes, size_t nsizes)
glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT, &maxTextureRectangleSize);
glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &maxTextureLayers);

size = min(maxTextureSize, maxTextureRectangleSize);
size = std::min(maxTextureSize, maxTextureRectangleSize);

RandomSeed seed(gRandomSeed);

// Generate some random sizes (within reasonable ranges)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].height = random_in_range(2, min(size, 1 << (i + 4)), seed);
sizes[i].width = random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, std::min(size, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
}
}

Expand Down
12 changes: 5 additions & 7 deletions test_conformance/gl/test_images_multisample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

#include <algorithm>

using namespace std;

void calc_2D_multisample_size_descriptors(sizevec_t* sizes, size_t nsizes)
{
// Need to limit texture size according to GL device properties
Expand All @@ -39,9 +37,9 @@ void calc_2D_multisample_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].depth = 1;
}
}
Expand All @@ -59,11 +57,11 @@ void calc_2D_array_multisample_size_descriptors(sizevec_t* sizes, size_t nsizes)
for (size_t i = 0; i < nsizes; i++)
{
sizes[i].width =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].height =
random_in_range(2, min(maxTextureSize, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureSize, 1 << (i + 4)), seed);
sizes[i].depth =
random_in_range(2, min(maxTextureLayers, 1 << (i + 4)), seed);
random_in_range(2, std::min(maxTextureLayers, 1 << (i + 4)), seed);
}
}

Expand Down
7 changes: 3 additions & 4 deletions test_conformance/spirv_new/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ const std::string spvVersionSkipArg = "--skip-spirv-version-check";

std::vector<unsigned char> readBinary(const char *file_name)
{
using namespace std;

ifstream file(file_name, ios::in | ios::binary | ios::ate);
std::ifstream file(file_name,
std::ios::in | std::ios::binary | std::ios::ate);

std::vector<char> tmpBuffer(0);

if (file.is_open()) {
size_t size = file.tellg();
tmpBuffer.resize(size);
file.seekg(0, ios::beg);
file.seekg(0, std::ios::beg);
file.read(&tmpBuffer[0], size);
file.close();
} else {
Expand Down
Loading