Skip to content
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
4 changes: 0 additions & 4 deletions build_overrides/gpgmm_features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ declare_args() {
# Sets -dGPGMM_SHARED_LIBRARY
gpgmm_shared_library = false

# Enables recording until program termination.
# Sets -dGPGMM_ENABLE_RECORDING_UNTIL_TERMINATION
gpgmm_enable_recording_until_termination = false

# Enables checking of allocator leaks.
# Sets -dGPGMM_ENABLE_PRECISE_ALLOCATOR_DEBUG
gpgmm_enable_allocator_checks = is_debug
Expand Down
4 changes: 0 additions & 4 deletions src/gpgmm/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ source_set("gpgmm_sources") {
defines += [ "GPGMM_DISABLE_TRACING" ]
}

if (gpgmm_enable_recording_until_termination) {
defines += [ "GPGMM_ENABLE_RECORDING_UNTIL_TERMINATION" ]
}

if (gpgmm_enable_allocator_checks) {
defines += [ "GPGMM_ENABLE_ALLOCATOR_CHECKS" ]
}
Expand Down
9 changes: 3 additions & 6 deletions src/gpgmm/TraceEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

namespace gpgmm {

static EventTraceWriter* gEventTrace;
static std::unique_ptr<EventTraceWriter> gEventTrace;
static std::mutex mMutex;

static EventTraceWriter* GetInstance() {
std::lock_guard<std::mutex> lock(mMutex);
if (gEventTrace == nullptr) {
gEventTrace = new EventTraceWriter();
gEventTrace = std::make_unique<EventTraceWriter>();
}
return gEventTrace;
return gEventTrace.get();
}

void StartupEventTrace(const std::string& traceFile,
Expand All @@ -39,9 +39,6 @@ namespace gpgmm {
TRACE_EVENT_METADATA1(TraceEventCategory::Metadata, "thread_name", "name",
"GPGMM_MainThread");

#if !defined(GPGMM_ENABLE_RECORDING_UNTIL_TERMINATION)
GetInstance()->FlushQueuedEventsToDisk();
#endif
GetInstance()->SetConfiguration(traceFile, skipDurationEvents, skipObjectEvents,
skipInstantEvents);
}
Expand Down
64 changes: 0 additions & 64 deletions src/tests/end2end/D3D12ResourceAllocatorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,70 +143,6 @@ TEST_F(D3D12ResourceAllocatorTests, CreateAllocator) {
}
}

TEST_F(D3D12ResourceAllocatorTests, CreateAllocatorRecord) {
ALLOCATOR_DESC desc = CreateBasicAllocatorDesc();
desc.RecordOptions.Flags =
static_cast<ALLOCATOR_RECORD_FLAGS>(ALLOCATOR_RECORD_FLAG_ALL_EVENTS);

// Creating a new allocator that uses default record options should always succeed.
{
ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(desc, &allocator));
EXPECT_NE(allocator, nullptr);
}

// Creating a new allocator that specifies a trace name should always succeed.
{
ALLOCATOR_DESC newDesc = desc;
newDesc.RecordOptions.TraceFile = "test.json";

ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator));
EXPECT_NE(allocator, nullptr);
}

// Creating a new allocator using various recording levels should always succeed.
{
ALLOCATOR_DESC newDesc = desc;
newDesc.RecordOptions.MinMessageLevel =
static_cast<ALLOCATOR_MESSAGE_SEVERITY>(ALLOCATOR_MESSAGE_SEVERITY_MESSAGE);

ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator));
EXPECT_NE(allocator, nullptr);
}

{
ALLOCATOR_DESC newDesc = desc;
newDesc.RecordOptions.MinMessageLevel =
static_cast<ALLOCATOR_MESSAGE_SEVERITY>(ALLOCATOR_MESSAGE_SEVERITY_INFO);

ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator));
EXPECT_NE(allocator, nullptr);
}

{
ALLOCATOR_DESC newDesc = desc;
newDesc.RecordOptions.MinMessageLevel =
static_cast<ALLOCATOR_MESSAGE_SEVERITY>(ALLOCATOR_MESSAGE_SEVERITY_WARNING);

ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator));
EXPECT_NE(allocator, nullptr);
}

{
ALLOCATOR_DESC newDesc = desc;
newDesc.RecordOptions.MinMessageLevel =
static_cast<ALLOCATOR_MESSAGE_SEVERITY>(ALLOCATOR_MESSAGE_SEVERITY_ERROR);

ComPtr<ResourceAllocator> allocator;
ASSERT_SUCCEEDED(ResourceAllocator::CreateAllocator(newDesc, &allocator));
EXPECT_NE(allocator, nullptr);
}
}

// Exceeding the max resource heap size should always fail.
TEST_F(D3D12ResourceAllocatorTests, CreateBufferOversized) {
constexpr uint64_t kOversizedBuffer = 32ll * 1024ll * 1024ll * 1024ll; // 32GB
Expand Down