Multithreaded Game Programming and Hyper-Threading Technology

Microarchitecture: HyperThreading(超线程) 线程并行 当代的软件趋向于运行在多线程模式,或者是并行处理。网络包传输和web服务可以运行以多线程的方式运行以达到更高的性能。甚至是桌面应用也开始增加并行性。Intel架构师已经开始尝试利用TLP( thread-level parallelism) 线程并行性,用来在较少的晶体管和功耗下就能达到更高的性能。 高端和终端的服务器市场,多核已经被广泛的使用,已获得更高的性能。通过增加处理器,应用... 阅读详情
Multithreaded Game Programming and Hyper-Threading Technology
Published On: Tuesday, July 24, 2007 | Last Modified On: Tuesday, July 24, 2007
Overview
By Will Damon

Multiprocessor machines are becoming more commonplace on the desktop with the introduction of  Hyper-Threading Technology to the Intel® Pentium® 4 processor. While multithreaded programming is not new to games, the widespread adoption of multiprocessor machines means that programmers can seriously consider the threaded performance of algorithms, and software system design. This paper aims to introduce the two domains of threading methodology as they apply to game development, and address the most common pitfalls of game programming for Hyper-Threading Technology (HT) enabled systems.

Parallel Models

Parallelism, the simultaneous processing of different data or tasks, is achieved through two models: data- and functional- decomposition (also known as data and task parallelism). As the names imply, these two models represent very different yet complementary methods of applying multiple threads to achieve a higher level of performance within a single process (like a game). Each parallel model has its own section below; data decomposition is covered first, followed by functional decomposition.


Data Decomposition
Data decomposition means that the same independent operation is applied to different data. Compute-intensive loops, like those found in game physics simulation solvers, for example, are good candidates for data parallelization. Each game has different situations in which data parallelism applies, but just for illustration, here is a short list that is by no means exhaustive:

  • Generating procedural terrain, textures, or geometry
  • Physics solvers (for collision, behavior, and even sound)
  • Skinning and/or animation
  • Various artificial intelligence algorithms
  • Path finding
  • Audio processing
Many other applications are also possible. The trick is determining when to use threads to implement parallel computation for higher performance.

The easiest way to find an area in a game that might benefit from data decomposition is to profile the game on a multiprocessor or HT-enabled system. The Intel® VTune™ Performance Analyzer is great for this because it tells exactly how much time is spent idle, as well as how much time running threads are consuming of each logical processor. A profile of a game on an HT-enabled system will give a clear indication of where the whole system is spending time, and how well the workload is balanced. Focusing on the heaviest time-consuming modules will point you to which modules may benefit from data decomposition, not to mention highlighting serial optimization opportunities, too. While threading can improve performance, additional wins may be achieved with other Intel® NetBurst™ microarchitecture optimizations. See item [11] in the Additional Resources section for more information on NetBurst microarchitecture optimizations.


Functional Decomposition
Functional decomposition works at a higher level than data decomposition. In functional decomposition, also known as task-parallelism, independent work is mapped to asynchronous threads. This model applies to games particularly well because there are typically so many different subsystems executing simultaneously. Some professional game developers have been threading their games for years, spawning threads to handle various subsystems, well before the introduction of Hyper-Threading Technology on the desktop. The advantage of functionally decomposing a game today, however, reaches beyond the scope of programmer convenience. Threads can run concurrently on HT-enabled hardware, yielding higher performance and more responsiveness; something which end users will appreciate. Additionally, having one ready-to-run thread per logical processor means that your game can consume idle processor cycles, again working towards higher performance. The number of ways in which you can separate subsystems is infinite; however, always keep in mind the general rule of thumb for multithreaded programming: make sure running threads conflict as little as possible!

A quick example to illustrate one possible approach to threading a game engine is to allow separate threads to handle the following subsystems:

  • Asynchronous Streaming (I/O)
  • AI
  • Audio
  • Input
  • Network
  • Physics
  • Rendering
  • UI
  • Other subsystems (video playback, garbage collection, etc.)
Potentially, it could make sense to combine some of these together into a single thread, but the idea is the same - separate decoupled systems into asynchronous threads for higher performance and more responsiveness in multithreading desktop environments. Threading your engine may allow you to do some interesting things that could potentially degrade performance on a serial (single-threaded) model, like execute more complex AI or run larger physics simulations. Additionally, depending on your game, threading might allow you to more easily run various decoupled subsystems at different refresh rates (e.g. physics at 100Hz, graphics at 60 Hz), yielding a smoother experience in a richer game environment for your players.


Three Threading Models
Understanding parallelism and how it may be applied are important, but knowing how it is most effectively implemented is equally important. The next three sections each discuss one of the three approaches to achieve parallelism; they are ordered from least invasive to most invasive in terms of the code base and time investment.

Automatic Parallelization

The simplest means of parallelizing loops (data decomposition) is to let the compiler do all the work for you. The Intel C++ Compiler, version 7.0 and later, has support to analyze loops and parallelize those that it considers good candidates. The -Qparallel switch enables the feature, and following a few simple guidelines increases the likelihood that the compiler will identify a parallel loop.

  • First, expose the trip count of the loop. This does not mean defining the trip count as a compiler directive. This means that the compiler must be able to determine whether the trip count varies during loop execution. For example, altering a for-loop counter inside the loop body could violate this first rule, and the compiler may not identify the loop as parallel.
  • Next, avoid branching from the loop. Branching can have a similar effect to failing the first guideline (expose trip count), in which the compiler cannot determine whether the loop is a parallel candidate.
  • The third guideline is to avoid referencing global data or procedure calls from within the loop body. The compiler cannot guarantee correct parallel execution on the volatile elements, so loops with such references may not generate parallel code. However, referencing a pure function, a function which has no side effects, does not disrupt parallelism.
Failure to adhere to these guidelines does not automatically disqualify a loop from automatic parallelization. Use the -Qpar_report3 switch to have the compiler generate a report on which loops were successfully parallelized and the dependencies that prevent parallelization of others. ( -Qpar_report[n] will allow varying degrees of reporting.)

Compiler-directed Parallelism with OpenMP

While automatic parallelization is great, there are times when the developer can, or would like to direct the compiler what to thread. After all, you know much more about the overlying algorithm than the compiler could ever attempt to understand. The OpenMP standard allows the developer the kind of flexibility s/he desires, while limiting the time investment necessary to thread code. OpenMP works on an explicit fork/join method, so the programmer must specify the start and end of a parallel region.

The Intel C++ Compiler version 7.0 supports OpenMP, but not all C++ compilers at the time of this writing do so. Use the -Qopenmp switch to enable processing of the OpenMP directives or pragmas to generate threaded code. Without this switch, the Intel C++ Compiler will do the same thing as compilers that do not support OpenMP, and simply ignore the directives.

The cool thing about OpenMP is that it allows easy parallelization of loops or regions of your code without large-scale modifications. In fact, the original serial code is left largely intact. The following example that calculates a height field for a patch of terrain demonstrates:

#include <omp.h>

int TerrainManager::InitializePatches(D3DWrapper* pD3DWrapper, int PatchDivisions,
int SubPatchesX, int SubPatchesZ)
{
    int idx, z, x;

    if( PatchDivisions < 1 )
        PatchDivisions = 1;
    if( SubPatchesX < 1 )
        SubPatchesX = 1;
    if( SubPatchesZ < 1 )
        SubPatchesZ = 1;
   
    mPatchDivisions = PatchDivisions;

    mPatchesX = SubPatchesX;
    mPatchesZ = SubPatchesZ;

    mNumPatches = SubPatchesX * SubPatchesZ;
    mpPatches = new TerrainPatchLOD*[mNumPatches];

#pragma omp parallel
    {
        float fScaleX = 1.0f / (float)SubPatchesX;
        float fScaleZ = 1.0f / (float)SubPatchesZ;

        Vector3 tPos1, tPos2;
        tPos1.Y = tPos2.Y = 0.0f;

#pragma omp for private(idx)
        for (z=0; z<SubPatchesZ; z++)
        {
            tPos2.Z = float(SubPatchesZ/2-z);
            for (x=0; x<SubPatchesX; x++)
            {
                tPos2.X = float(x - SubPatchesX / 2);
                idx = z*SubPatchesX + x;

                mpPatches[idx] = new TerrainPatchLOD( mFlags, mSeed );
                mpPatches[idx]->UseLOD(true); //use lowerLOD patches
                              where there is no override

                mpPatches[idx]->SetScale( Vector3( fScaleX, fScaleX, fScaleZ ) );
                tPos1.X = -0.5f + fScaleX * (float)x + fScaleX / 2.0f;
                tPos1.Z =  0.5f - fScaleZ * (float)z - fScaleZ / 2.0f;
                mpPatches[idx]->SetPos( tPos1 );
                mpPatches[idx]->mUnscaledPosition = tPos2;
                mpPatches[idx]->SetTextureCoords( x * fScaleX,
                               fScaleX, 1.0f - (z+1) * fScaleZ, fScaleZ );
                mpPatches[idx]->Init( pWrapper, PatchDivisions );
#pragma omp critical
                AddChild( mpPatches[idx] );
            }
        }
    }

    //-- Complete initialization process

    return SUCCESS;
}

In the above example, the loop to generate all the terrain data is threaded with three short lines of OpenMP directives. Efficient parallelization is achieved with very minimal programming effort, and the function speeds up (versus the serial version) by a measurable factor on a Pentium 4 processor with Hyper-Threading Technology.

Thread Libraries

Last, but not least, the developer can use the thread libraries (e.g. Win32 threads, or pthreads) to drive explicitly defined threads. Thread libraries are flexible enough to address both data and functional decomposition, but using them for data decomposition is invasive, time consuming, and error-prone. Computations must be separated into functions that can be mapped to threads, and the work must be manually divided among the threads. Additionally, explicit synchronization must be added in order to guarantee correct results. To illustrate, we revisit the example from the previous section, and this time we'll thread it using Win32 threads:

/**
    In TerrainManager.h ...
*/
class TerrainManager
{
protected:
    CriticalSection TERRAIN_BUILD_CS;

    static DWORD WINAPI BuildNextHalfOf(LPVOID arg)
    {
        ((IawTerrainArray*)arg)->BuildHalfOf();
        return 0;
    }
};

/**
    In TerrainManager.cpp ...
*/
void TerrainManager::BuildHalfOf()
{
    static int c = 0;

    int startz, endz, idx;

    EnterCriticalSection(&TERRAIN_BUILD_CS);

    if (!c)
    {
        startz = 0;
        endz   = mPatchesZ / 2;
        c++;
    }
    else
    {
        startz = mPatchesZ / 2;
        endz   = mPatchesZ;
        c--;
    }

    LeaveCriticalSection(&TERRAIN_BUILD_CS);

    float fScaleX = 1.0f / (float)mPatchesX;
    float fScaleZ = 1.0f / (float)mPatchesZ;

    Vector3 tPos1, tPos2;
    tPos1.Y = tPos2.Y = 0.0f;

    for (int z = startz; z < endz; z++)
    {
        tPos2.Z = float(mPatchesZ / 2 - z);

        for (int x = 0; x < mPatchesX; x++)
        {
            tPos2.X = float(x - mPatchesX / 2);
            idx = z*mPatchesX + x;

            mpPatches[idx] = new TerrainPatchLOD( mFlags, mSeed );
            mpPatches[idx]->UseLOD(true);
            mpPatches[idx]->SetScale( Vector3( fScaleX, fScaleX, fScaleZ ) );

            tPos1.X = -0.5f + fScaleX * (float)x + fScaleX / 2.0f;
            tPos1.Z =  0.5f - fScaleZ * (float)z - fScaleZ / 2.0f;

            mpPatches[idx]->SetPos( tPos1 );
            mpPatches[idx]->mUnscaledPosition = tPos2;
            mpPatches[idx]->SetTextureCoords( x * fScaleX, fScaleX, 1.0f -
                          (z+1) * fScaleZ, fScaleZ );
            mpPatches[idx]->Init( mp_D3DWrapper, mPatchDivisions );

            EnterCriticalSection(&TERRAIN_BUILD_CS);
            AddChild( mpPatches[idx] );
            LeaveCriticalSection(&TERRAIN_BUILD_CS);
        }
    }
}

int TerrainManager::InitializePatches(D3DWrapper* pD3DWrapper,
int PatchDivisions, int SubPatchesX, int SubPatchesZ)
{
    mp_D3DWrapper = pD3DWrapper;

    if( PatchDivisions < 1 )
        PatchDivisions = 1;
    if( SubPatchesX < 1 )
        SubPatchesX = 1;
    if( SubPatchesZ < 1 )
        SubPatchesZ = 1;

    mPatchDivisions = PatchDivisions;

    mPatchesX = SubPatchesX;
    mPatchesZ = SubPatchesZ;

    mNumPatches = SubPatchesX * SubPatchesZ;
    mpPatches = new TerrainPatchLOD*[mNumPatches];

    InitializeCriticalSection(&TERRAIN_BUILD_CS);

    const int num_threads = 2; // Number of threads = logical processors

    HANDLE hThread[num_threads];
    for (int i = 0; i < num_threads; i++)
        hThread[i] = CreateThread( NULL,
                                   0,
                                   TerrainManager::BuildNextHalfOf,
                                   (LPVOID)this,
                                   0,
                                   NULL );

    float fScaleX = 1.0f / (float)SubPatchesX;
    float fScaleZ = 1.0f / (float)SubPatchesZ;

    //-- Complete initialization process

    WaitForMultipleObjects( num_threads,
                            hThread,
                            TRUE,
                            INFINITE );

    DeleteCriticalSection(&TERRAIN_BUILD_CS);

    for (int i = 0; i < num_threads; i++)
        CloseHandle(hThread[i]);

    return SUCCESS;
}

As you can see, there is a bit more code involved here to accomplish the same data decomposition as in the previous example. However, the benefit of the threading libraries is the powerful flexibility and direct programmer control they provide. Using the threaded libraries correctly is important. Notice here that we create and delete the thread handles in the same class method. Generally this is something you should avoid except in one-time initialization situations. Creating threads is expensive; therefore, if using the threading libraries, it is probably worthwhile to generate a thread pool during initialization, and set events to wake up threads to perform their tasks when necessary. When the threads finish their tasks, they can go back to a resting state, releasing hardware resources for other tasks. See items [1] and [12] in the Additional Resources section for more information on thread pools.


Coding for Hyper-Threading Technology
Whether you're developing for a high-end 4-way or 8-way Intel® Xeon® processor system or a Hyper-Threading Technology enabled Pentium® 4 processor-based desktop system, paying attention to how threads are executing is important. Employing techniques to achieve good load balancing, cache blocking, and general effective utilization of the hardware is very important on an HT-enabled processor because the two logical processors share common execution resources. This means that even though two threads are running concurrently, they are competing for some of the same hardware resources. Keep in mind some of the following common programming pitfalls when targeting a Hyper-Threading Technology system, and avoid hard-to-diagnose performance problems later on during the optimization cycle.

Synchronization

Make sure running threads conflict as little as possible!
For synchronization on variables that you know are going to be imminently available, a simple spin-wait loop may suffice. Be careful, though, because spin-waits can quickly become a hindrance on performance. A spin-wait locks up processor resources because it runs so efficiently, therefore stalling both logical processors. Inserting an assembly-level pause instruction can alleviate the detrimental effects of spin-waits, and looks like so:

// Tight spin-wait loop that can lead to performance issues
while (synch_var != some_val) { }

// Tight spin-wait loop with pause instruction;
// fixes performance issue from above
while (synch_var != some_val)
{
     _asm pause
}

The pause instruction hints to the processor that the loop is spin-wait, and inserts a momentary pause into execution to allow the processor resources to be freed up for the other logical processor. Another way to slow down the tight spin-wait is to put the waiting thread to sleep. Either use the ANSI standard sleep(), or the Win32 Sleep(). The argument for the ANSI standard sleep() is the number of seconds for the thread to sleep, while the Win32 Sleep() uses milliseconds. Use whichever makes more sense for your game.

// Tight spin-wait loop that sleeps one tenth of one second
while (synch_var != some_val) { Sleep(100); }

Lastly, when you know the thread will be waiting for some indeterminate amount of time, the best way to synchronize is to tell the OS what the thread is doing. Under Windows* using the thread blocking APIs (e.g. WaitForSingleObject(), WaitForMultipleObjects()) will let you do just that.

In addition to all the explicit synchronization your code is aware of, be careful of implicit synchronization. For example, allocating memory off the heap will cause synchronization to occur. Avoid such thread synchronization by using the thread local stack allocation API TlsAlloc() or _alloca(). Also be careful of accessing global variables, as doing so may also cause synchronization.

64k Alias Conflicts

A 64K-aliasing conflict happens when a virtual memory address references a cache line that is modulo 64 kilobytes apart from another cache line that already resides in the L1 cache (see item [10] in the Additional Resources section). If the VTune™ Analyzer reports a 64K-aliasing event number increase of 5x or more on an HT-enabled system versus the same system with Hyper-Threading Technology disabled, then it is likely possible to achieve a meaningful speedup by alleviating some of the 64K-aliasing pressure. Generally two cases cause such an impact when Hyper-Threading Technology is enabled versus not:

  • Thread stacks aligned on one and two megabyte boundaries
  • Threads accessing data structures which happen to fall 64K (or modulo 64K) apart
Avoid these two common pitfalls by following a couple of guidelines provided by item [10] in the Additional Resources section and reinforced with further explanation here. First, try adjusting thread stack allocation thereby changing the relative addresses between offending accesses. This is an important guideline because the Win32 default for thread stack allocation is on 1MB boundaries, and thus has the potential to cause serious performance penalties on HT-enabled systems. In the case of interleaving or interspersed loads and stores from the same 64KB address space, try doing multiple loads then multiple stores. As far as data structures are concerned, there are a few things to try. One is to simply have your memory allocator allocate structures of 68KB instead of 64KB. Alternatively, your memory allocator might pad and return random offsets that are multiples of 128 bytes (for cache-friendliness and avoiding stalls due to unaligned loads). Finally, for multiple arrays, pad those that are multiple of 64KB in size, especially those that are accessed with the same index, so that they will not be allocated contiguously in memory. The simplest way to pad arrays is to artificially increase their sizes, or interleave their declarations with the declaration of other variables.

For more information about 64K-aliasing and how to avoid it see items [10] and [11] in the Additional Resources section.


Effective Cache Usage and Locality
Effective cache utilization is critical to top-end performance on both single- and multi-threading processors. Two common issues related to the cache that occur with multithreaded programming that can be avoided by developers are false sharing and poor data locality.

False Sharing

False sharing can cause some serious performance degradation on both dual- or multi-processor and HT-enabled systems. False sharing happens when multiple threads own private data on the same cache block. For Pentium 4 processors and Xeon processors, a cache block is effectively 128-bytes. Determining whether false sharing is an issue is easy with a profile from the VTune Analyzer, and fixing the problem is as easy as padding out data structures. Perhaps an even better fix is to structure data in a cache-friendly manner, on or at 128-byte boundaries. Note that these recommendations are very complimentary to those for avoiding 64K-aliasing, so watching out for one pitfall actually helps you prevent two or more! See item [5] in the Additional Resources section for a more in-depth explanation of false sharing.

The Cache Blocking Technique

The cache blocking technique restructures loops with frequent iterations over large data arrays by sub-dividing the large array into smaller blocks, or tiles. Each data element in the array is reused within the data block, such that the block of data fits within the data cache, before operating on the next block or tile. This technique is widely used in linear algebra, and is a common transformation applied by compilers and game programmers. Because HT-enabled processors share the L2 cache, the most effective target block size (or the sweet spot) is be somewhere around ~133KB per thread, or roughly a quarter of the full L2 cache size. See item [7] in the Additional Resources section for further details.

Write-Combining Store Buffers

Write-Combining Store Buffers are also a shared resource on HT-enabled systems. The Pentium 4 processor has six WC buffers, and in the past it has been recommended that programmers target four of the six, as the OS and other processes are likely consuming at least two. An example of targeting four WC buffers is writing to four addresses that fall on unique cache lines. With the WC buffers being shared, the recommendation for processors with HT technology is to only target two WC buffers per running thread. Again, the VTune Analyzer can help you determine whether WC buffer evictions are impacting performance. The solution to avoiding unwanted WC buffer evictions is to break apart a loop such that it only targets the recommended number of WC buffers.


Programming Tools
While you can keep an eye out for some issues and common pitfalls when developing code, you will find yourself debugging and/or fine-tuning some part of your game. Intel offers a full suite of tools to help you both reduce development time and increase your productivity.

  • Intel® C++ Compiler
  • The VTune™ Performance Analyzer
  • Intel® Thread Checker
  • Thread Profiler
  • Parallel Libraries
You can find out more about all these tools and how to effectively utilize them from http://www.intel.com/software/products/, http://developer.intel.com/ and http://www.intel.com/software.


Summary
In this exhaustive introduction we visited the models to achieve parallelism in your code, and discussed some of the common pitfalls and respective workarounds for developing threaded code for Hyper-Threading processors. We wrapped up our discussion with a very brief introduction to the software development tools provided by Intel. I encourage you to try out the tools right away and start experimenting with what is possible on today's advanced high-end desktop systems. Be aggressive with the application of the tools and their features; and profile often!

About the Author
Will Damon was a Technical Marketing Engineer within Intel's Software Solutions Group. He has a bachelor's degree in Computer Science from Virginia Polytechnic Institute and State University*, where he graduated with honors. He has been with Intel for over a year, helping game developers enable their titles to achieve the highest performance possible on Intel® Pentium® 4 processor-based PCs. He welcomes email regarding optimization, mathematics, physics, artificial intelligence, or anything else related to real-time 3D graphics, and gaming.


Additional Resources
4k aliasing对分块算法的影响和lapacke中行列主序的问题 由于程序运行时间测量的不准确性,虽然测量时间时已经采取了运行多次取中位值的方法,我不保证能够重现结果。下图是使用dgemm()矩阵乘法用时计算所得CPU浮点计算能力(Gflops,y轴,越大越好)随运行时间(x轴)变化的曲线。可见其波动是非常剧烈的,偶尔还会来个尖峰或者波谷。最底下的红线是笔记本低压U i7-8550U(外接电源),睿频结束后很快就稳定到110Gflops的位置。下图是AMD Th... 阅读详情

相关推荐

YOLO26算法城市街道老年人目标检测+训练好的模型+219张数据集+pyqt可视化界面.zip

附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[老年人(grand)] · 总计:219 张 · 测试集:0 张 · 验证集:0 张 · 训练集:219 张 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 100 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.9933** mAP50-95 | 0.9400 Precision | 0.9766 Recall | 1.0000 train/box_loss | 0.3217 train/cls_loss | 0.2660 val/box_loss | 0.3492 val/cls_loss | 0.2783 【训练过程分析】 训练开始的第一周,模型的损失函数快速收敛,box_loss 和 cls_loss 在第 5 轮左右迅速降至较低值,这表明模型对基本的边界框和类别检测能力有了初步的把握。然而,到了第 10 轮,loss 开始缓慢下降,这表明模型可能已经开始遇到一些困难,例如类别间的区分度不够。整体看,损失函数在前 30 轮的快速下降阶段,帮助模型迅速学习了基本的检测规则。而在接下来的训练阶段,loss 的下降速度有所减缓,这显示模型进入了学习平台期。 在第 40 轮到第 50 轮,mAP50 逐渐提升并稳定在一个较高的水平,达到 0.9933,这表明模型在训练后期对小目标的检测能力提升显著。尽管 mAP50-95 有所提升,但也仅达到 ... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。

Intel超线程技术 Hyper-Threading Technology (4) - 处理器资源与超线程(分区的资源/竞争共享的资源)

Partitioned Resources 某些缓冲区是共享使用的,但是每个逻辑处理器只能使用一半的条目。这些资源被称为分区的资源。分区的目的是: 操作上的公平性 当一个逻辑处理器上的执行停顿时,另一个逻辑处理器有能力可以继续执行。 例如:高速缓存未命中,分支预测失败,指令依赖都可能会将逻辑处理器执行指令阻塞数个周期。资源分区可以避免停顿的逻辑器阻塞另一个逻辑处理器的继续执行。 通常,位于...

一凡stkeke 1213

东汉AD188年世界历史地图矢量文件SHP格式.zip

本资源为《东汉AD188年世界历史地图矢量文件SHP格式》压缩包,文件大小约 28.55 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

Understand memory access characteristics of motion estimation algorithms

IntroductionBy Alex A. Lopez-EstradaApplications Engineer, Intel Software and Solutions GroupToday, processor computing power makes real-time video encoding and decoding using General Purpose Processo

hollysky的专栏 1631

ComfyUI/SeedVR2 ZIP 动物照片批量修复与放大

文件编号:c0310 把多张压缩照片打包成 ZIP,使用 SeedVR2 3B 逐张增强并保存为独立 PNG。本例以两张动物照验证批量输入、短边放大与逐张下载。 解压后将 c0310.json 导入 RunningHub 工作台,上传自己的 ZIP。若在本地 ComfyUI 使用,请按实际安装的节点、模型和版本调整工作流。

东汉AD181年世界历史地图矢量文件SHP格式.zip

本资源为《东汉AD181年世界历史地图矢量文件SHP格式》压缩包,文件大小约 28.36 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

UE4_多线程、异步执行任务

为什么要使用多线程,如果你是想找UE4的多线程资料,肯定不是一个小白了,所以多线程的好处就不用我告诉你了。 如果你想去感受一些多线程的好处,或者想去学习一个多线程的案例。建议,去看看这个博主的文章。 Unreal Engine 4 —— 多线程任务构建 多线程 多线程任务系统详解 该系统核心的几个概念 FQueuedThreadPool: 虚基类,定义线程池常用的接口。FQueueThreadPoolBase 继承FQueuedThreadPool,实现具体的方法。FQueueThreadPoolBa

longyanbuhui的博客 7275

东汉AD25年世界历史地图矢量文件SHP格式.zip

本资源为《东汉AD25年世界历史地图矢量文件SHP格式》压缩包,文件大小约 31.07 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见JSON 文件、属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

【创新未发表】绿电直连型电氢氨园区优化运行研究(Matlab代码、Python、数据、word论文)

内容概要:本文围绕“绿电直连型电氢氨园区优化运行”展开研究,提出一种集成绿色电力直接连接电解水制氢、合成氨的综合能源系统优化运行模型。研究构建了涵盖风电、光伏等可再生能源出力不确定性、电解槽制氢效率特性、氨合成能耗及多能存储协同调度的数学模型,并采用Matlab与Python进行联合仿真,结合实际气象与电价数据对系统经济性、能效与碳减排性能进行全面评估。文中提供了完整的代码、数据集及Word论文,重点探讨了源-荷-储协调机制、能量转化设备的运行策略以及多目标优化求解方法,旨在提升园区能源自给率与低碳水平。; 适合人群:具备一定电力系统、能源工程或优化算法基础的研究生、科研人员及从事新能源系统规划的技术人员。; 使用场景及目标:①用于开展可再生能源耦合氢能与化工生产的综合能源系统建模与仿真;②支撑低碳工业园区、零碳示范区的规划设计与运行优化研究;③作为学习多能互补系统优化、电氢氨协同调度的实践案例。; 阅读建议:建议结合提供的Matlab代码与Python脚本,逐步调试运行模型,重点关注目标函数构建、约束条件设置及求解器调用逻辑,同时参考论文部分深入理解模型设计思路与实际应用场景。

东汉AD124年世界历史地图矢量文件SHP格式.zip

本资源为《东汉AD124年世界历史地图矢量文件SHP格式》压缩包,文件大小约 29.23 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

两汉之间AD22年世界历史地图矢量文件SHP格式.zip

本资源为《两汉之间AD22年世界历史地图矢量文件SHP格式》压缩包,文件大小约 29.20 MB,便于集中下载、整理和使用。具体内容请结合压缩包内的实际文件与说明查看。 在当前可读取的目录中,可见JSON 文件、属性表(.dbf)、投影说明文件(.prj)、Shapefile 主文件(.shp)、Shapefile 索引(.shx)。建议解压后保持原有目录结构,先浏览文件清单与说明,再选择需要的资料进行加载或整理。 应用方面,可根据实际资料用于学习练习、资料检索、研究整理或项目参考。使用时可先确定所需内容,建立清晰的文件分类,再按项目要求进行筛选、转换与汇总。 使用 Shapefile 数据时,请把实际配套的 .shp、.shx、.dbf 等文件保存在同一目录,并保持同名关联;加载后再检查坐标系与中文字段显示。如需叠加其它数据,请先统一坐标与字段口径。 数据来源、时间范围、坐标系、字段定义、精度和使用条件,请以实际文件及原始说明为准。本介绍不对文件名之外尚未核实的信息作额外承诺。

无人机无人机在时变风下跟随策略的路径模拟(Matlab实现)

【无人机】无人机在时变风下跟随策略的路径模拟(Matlab实现)

text-to-cad-一款让 AI Coding Agent 直接变身全栈工业工程师的本地插件,用自然语言就能生成可制造的 3D 实体模型、PCB 电路板和工程图纸

text-to-cad-一款让 AI Coding Agent 直接变身全栈工业工程师的本地插件,用自然语言就能生成可制造的 3D 实体模型、PCB 电路板和工程图纸。 核心场景: 代码化生成精密 3D 零件与装配体: 不用在传统 CAD 软件里死磕鼠标,直接对 Claude Code、Cursor、Codex 或 Trae 下达需求。插件会调用 build123d 和 OpenCASCADE 内核写 Python 脚本建模,实时在本地预览器渲染带关节运动的装配体,并导出 STEP、STL、3MF、GLB 或激光切割用的 DXF 展开图。 无头模式画 PCB 与布线: 集成自研的 headless KiCad 工具链(kicode),无需完整安装庞大的 KiCad 软件,直接让 AI 生成原理图、自动布局布线并跑通 ERC/DRC 电气规则检查,直接输出制板文件。 可制造性与有限元应力体检: 建模完直接做 DFM(可制造性)检查,判断零件能不能 CNC 铣削、钣金折弯或注塑;还能调用 CalculiX 求解器做受力分析,直接在模型上标出峰值应力、安全系数和形变量。 一键出工程图、渲染与切片: 自动投影带尺寸标注、中心线、孔位说明和标题栏的 PDF 工程图;调用 Blender GPU 渲染产品级效果图和转盘动画;甚至能直连 OrcaSlicer 切片发给拓竹,或对接 SendCutSend 激光切割报价。 机器人物理仿真建模: 直接从 CAD 装配体生成适用于 ROS 的 URDF、MoveIt 的 SRDF 以及 MuJoCo 的 MJCF 机器人与环境描述文件

王堃阳.总裁口才私教和公开课差在哪.pdf

王堃阳.总裁口才私教和公开课差在哪

13 《脱敏演讲训练感悟》 教培机构校长 台下不是学生.docx

13 《脱敏演讲训练感悟》 教培机构校长 台下不是学生

48 《脱敏演讲训练感悟》 物业公司经理 学会在台上认错.docx

48 《脱敏演讲训练感悟》 物业公司经理 学会在台上认错

DevOps基于GitLab Runner的CI/CD流水线设计:Shell与Docker执行器下的自动化部署、多环境发布及一键回滚实现

内容概要:本文是一份关于 GitLab 自动化部署的完整工程技术操作手册,系统讲解了从 Runner 注册、环境准备、CI/CD 流水线编写到多环境发布、健康检查与回滚的全流程。重点涵盖 Shell 与 Docker 两种执行器的配置差异、目录结构设计、SSH 免密登录与权限控制、.gitlab-ci.yml 编排逻辑、安全最佳实践以及常见问题排查方法。通过实际示例展示如何实现原子化发布、自动健康检测与快速回滚机制,强调部署过程中的权限隔离、审计追踪与稳定性保障。 适合人群:具备 Linux 基础、熟悉 Git 和基本 DevOps 概念,从事开发、运维或 DevOps 工程师岗位,工作年限 1-3 年的技术人员。; 使用场景及目标:① 搭建基于 GitLab 的自动化部署流水线,实现代码提交后自动构建、测试与部署;② 实现生产环境手动发布、测试环境自动发布、部署回滚与故障恢复;③ 提升发布安全性与可靠性,防止并发部署冲突、权限滥用和人为误操作。 阅读建议:此资源以实战为导向,建议读者结合自身项目环境逐步实践文中步骤,优先在测试环境中验证 Shell 方案的完整性,再过渡到 Docker 容器化部署。重点关注变量管理、脚本幂等性、resource_group 控制并发、健康检查逻辑及回滚机制的设计,确保在真实生产场景中具备可落地性和高可用性。

K-近邻算法: k-nearest neighbor classification (kNN) 详细介绍

@创建于:2020.04.09 @修改于:2020.04.09,2024.06.22 文章目录1、kNN介绍2、k近邻法的三要素详解2.1 距离度量2.2 k值的选择2.3 分类决策规则3、k近邻法的实现:kd树4、Python实现过程5、优缺点6、常见问题 1、kNN介绍 kNN是一个基本而简单的分类算法,作为监督学习,那么KNN模型需要的是有标签的训练数据,对于新样本的类别由与新样本距离最近的k个训练样本点按照分类...

chenhepg的博客 9万+
上一篇: Open Source Game Development
下一篇: DirectDraw Tutorial 1
nette
博客等级 码龄20年 61粉丝 23原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址