mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 05:11:15 -06:00
This algorithm is used to determine whether or not a test can execute with the available resources. It uses a recursive largest- first algorithm to try to place the tests into their respective slots.
32 lines
903 B
C++
32 lines
903 B
C++
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
|
#ifndef cmCTestBinPacker_h
|
|
#define cmCTestBinPacker_h
|
|
|
|
#include <cstddef>
|
|
#include <map>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "cmCTestHardwareAllocator.h"
|
|
|
|
struct cmCTestBinPackerAllocation
|
|
{
|
|
std::size_t ProcessIndex;
|
|
int SlotsNeeded;
|
|
std::string Id;
|
|
|
|
bool operator==(const cmCTestBinPackerAllocation& other) const;
|
|
bool operator!=(const cmCTestBinPackerAllocation& other) const;
|
|
};
|
|
|
|
bool cmAllocateCTestHardwareRoundRobin(
|
|
const std::map<std::string, cmCTestHardwareAllocator::Resource>& hardware,
|
|
std::vector<cmCTestBinPackerAllocation>& allocations);
|
|
|
|
bool cmAllocateCTestHardwareBlock(
|
|
const std::map<std::string, cmCTestHardwareAllocator::Resource>& hardware,
|
|
std::vector<cmCTestBinPackerAllocation>& allocations);
|
|
|
|
#endif
|