Skip to content

Commit

Permalink
Ensure a consistent line-endings policy
Browse files Browse the repository at this point in the history
I just went to change one line in a file, then found out the whole file
changed since it was committed differently to my local system, and we
don't do normalisation yet. This fixes that.

Here we add a .gitattributes file at the top level with the policy
`* text=auto` which roughly translates as files that git considers
"text" are stored internally in history as LF and checked out according
to local user preference (which might be CRLF on a certain person's
Win32 box, for example).

In addition to the new .gitattributes, files that had CRLF line-endings
in the history have been renormalized with `git add --renormalize .`.

This should make cross-platform development easier while respecting
local configs.

When in Rome...
  • Loading branch information
ldrumm committed May 23, 2024
1 parent fb3cbd1 commit 044b280
Show file tree
Hide file tree
Showing 5 changed files with 458 additions and 457 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
36 changes: 18 additions & 18 deletions source/adapters/level_zero/ur_level_zero.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
//===--------- ur_level_zero.cpp - Level Zero Adapter ---------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <algorithm>
#include <climits>
#include <string.h>

#include "ur_level_zero.hpp"

// Define the static class field
std::mutex ZeCall::GlobalLock;
//===--------- ur_level_zero.cpp - Level Zero Adapter ---------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <algorithm>
#include <climits>
#include <string.h>

#include "ur_level_zero.hpp"

// Define the static class field
std::mutex ZeCall::GlobalLock;
76 changes: 38 additions & 38 deletions source/adapters/level_zero/ur_level_zero.hpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
//===--------- ur_level_zero.hpp - Level Zero Adapter ---------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#pragma once

#include <cassert>
#include <cinttypes>
#include <list>
#include <map>
#include <stdarg.h>
#include <string>
#include <unordered_map>
#include <vector>

#include <ur/ur.hpp>
#include <ur_api.h>
#include <ze_api.h>
#include <zes_api.h>

#include "common.hpp"
#include "context.hpp"
#include "device.hpp"
#include "event.hpp"
#include "image.hpp"
#include "kernel.hpp"
#include "memory.hpp"
#include "physical_mem.hpp"
#include "platform.hpp"
#include "program.hpp"
#include "queue.hpp"
#include "sampler.hpp"
#include "usm.hpp"
//===--------- ur_level_zero.hpp - Level Zero Adapter ---------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#pragma once

#include <cassert>
#include <cinttypes>
#include <list>
#include <map>
#include <stdarg.h>
#include <string>
#include <unordered_map>
#include <vector>

#include <ur/ur.hpp>
#include <ur_api.h>
#include <ze_api.h>
#include <zes_api.h>

#include "common.hpp"
#include "context.hpp"
#include "device.hpp"
#include "event.hpp"
#include "image.hpp"
#include "kernel.hpp"
#include "memory.hpp"
#include "physical_mem.hpp"
#include "platform.hpp"
#include "program.hpp"
#include "queue.hpp"
#include "sampler.hpp"
#include "usm.hpp"
48 changes: 24 additions & 24 deletions source/ur/ur.cpp
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@

//===--------- ur.cpp - Unified Runtime ----------------------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "ur.hpp"
#include <cassert>

// Controls tracing UR calls from within the UR itself.
bool PrintTrace = [] {
const char *PiRet = std::getenv("SYCL_PI_TRACE");
const char *Trace = PiRet ? PiRet : nullptr;
const int TraceValue = Trace ? std::stoi(Trace) : 0;
if (TraceValue == -1 || TraceValue == 2) { // Means print all traces
return true;
}
return false;
}();

//===--------- ur.cpp - Unified Runtime ----------------------------------===//
//
// Copyright (C) 2023 Intel Corporation
//
// Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM
// Exceptions. See LICENSE.TXT
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "ur.hpp"
#include <cassert>

// Controls tracing UR calls from within the UR itself.
bool PrintTrace = [] {
const char *PiRet = std::getenv("SYCL_PI_TRACE");
const char *Trace = PiRet ? PiRet : nullptr;
const int TraceValue = Trace ? std::stoi(Trace) : 0;
if (TraceValue == -1 || TraceValue == 2) { // Means print all traces
return true;
}
return false;
}();
Loading

0 comments on commit 044b280

Please sign in to comment.