Performing Calculations on a GPU 在显卡上进行计算

Meta开源AGI战略解析:Llama模型、PyTorch生态与AI智能体开发指南 通用人工智能(AGI)作为人工智能发展的长期目标,其核心原理在于构建具备通用认知与任务解决能力的系统。当前技术价值体现在通过开源框架降低研发门槛,推动创新民主化。在应用场景上,开源大模型与智能体框架正加速企业级AI解决方案落地。本文聚焦Meta的开源战略,深入分析其以Llama系列模型和PyTorch生态为核心的技术路径,探讨如何基于开源智能体框架进行工程实践,为开发者提供从模型微调到智能体应用开发的全链路实操参考。 阅读详情

Performing Calculations on a GPU

平台:Xcode iOS开发,初级,认识显卡开发
适用:显卡编程初学者,C++ OC 或metal openGL 初步英语能力

内容:Use Metal to find GPUs and perform calculations on them.

Overview

In this sample, you’ll learn essential非常重要的 tasks that are used in all Metal apps.
You’ll see how to convert a simple function written in C to Metal Shading Language (MSL) so that it can be run on a GPU.
You’ll find a GPU, prepare the MSL function to run on it by creating a pipeline, and create data objects accessible to the GPU.
To execute the pipeline against对应 your data, create a command buffer, write commands into it, and commit the buffer to a command queue.
Metal sends the commands to the GPU to be executed.

Write a GPU Function to Perform Calculations

To illustrate举例说明 GPU programming, this app adds corresponding相应的 elements of two arrays together, writing the results to a third array.
Listing 1 shows a function that performs this calculation on the CPU, written in C.
It loops over the index, calculating one value per iteration of the loop.

Listing 1 Array addition, written in C

void add_arrays(const float* inA,
                const float* inB,
                float* result,
                int length)
{
    for (int index = 0; index < length ; index++)
    {
        result[index] = inA[index] + inB[index];
    }
}

Each value is calculated independently独立的, so the values can be safely calculated concurrently一致的.
To perform the calculation on the GPU, you need to rewrite this function in Metal Shading Language (MSL).
MSL is a variant变体 of C++ designed for GPU programming.
In Metal, code that runs on GPUs is called a shader着色器, because historically they were first used to calculate colors in 3D graphics.
Listing 2 shows a shader in MSL that performs the same calculation as Listing 1.
The sample project defines this function in the add.metal file.
Xcode builds all .metal files in the application target and creates a default Metal library, which it embeds嵌入 in your app.
You’ll see how to load the default library later in this sample.

Listing 2 Array addition, written in MSL

kernel void add_arrays(device const float* inA,
                       device const float* inB,
                       device float* result,
                       uint index [[thread_position_in_grid]])
{
    // the for-loop is replaced with a collection of threads, each of which
    // calls this function.
    result[index] = inA[index] + inB[index];
}

Listing 1 and Listing 2 are similar, but there are some important differences in the MSL version. Take a closer look at Listing 2.

First, the function adds the kernel keyword, which declares that the function is:

  • A public GPU function. Public functions are the only functions that your app can see. Public functions also can’t be called by other shader functions.
  • A compute function (also known as a compute kernel), which performs a parallel并行的 calculation using a grid of threads.

See Using a Render Pipeline to Render Primitives to learn the other function keywords used to declare public graphics functions.

The add_arrays function declares three of its arguments with the device keyword, which says that these pointers are in the device address space.
MSL defines several disjoint不连续的 address spaces for memory.
Whenever任何时候 you declare a pointer in MSL, you must supply a keyword to declare its address space.
Use the device address space to declare persistent持续的 memory that the GPU can read from and write to.

Listing 2 removes the for-loop from Listing 1, because the function is now going to be called by multiple threads in the compute grid.
This sample creates a 1D grid of threads that exactly matches the array’s dimensions, so that each entry in the array is calculated by a different thread.

To replace the index previously provided by the for-loop, the function takes a new index argument, with another MSL keyword, thread_position_in_grid, specified using C++ attribute syntax.
This keyword declares that Metal should calculate a unique index for each thread and pass that index in this argument.
Because add_arrays uses a 1D grid, the index is defined as a scalar integer.
Even though the loop was removed, Listing 1 and Listing 2 use the same line of code to add the two numbers together.
If you want to convert similar code from C or C++ to MSL, replace the loop logic with a grid in the same way.

Find a GPU

In your app, a [MTLDevice][MTLDevice] object is a thin abstraction for a GPU; you use it to communicate with a GPU.
Metal creates a MTLDevice for each GPU.
You get the default device object by calling [MTLCreateSystemDefaultDevice()][MTLCreateSystemDefaultDevice].
In macOS, where a Mac can have multiple GPUs, Metal chooses one of the GPUs as the default and returns that GPU’s device object.
In macOS, Metal provides other APIs that you can use to retrieve all of the device objects, but this sample just uses the default.

id<MTLDevice> device = MTLCreateSystemDefaultDevice();

Initialize Metal Objects

Metal represents描述 other GPU-related相关的 entities实体, like compiled shaders, memory buffers and textures, as objects对象.
To create these GPU-specific objects, you call methods on a [MTLDevice][MTLDevice] or you call methods on objects created by a [MTLDevice][MTLDevice].
All objects created directly or indirectly by a device object are usable only with that device object.
Apps that use multiple GPUs will use multiple device objects and create a similar hierarchy of Metal objects for each.

The sample app uses a custom MetalAdder class to manage the objects it needs to communicate with the GPU.
The class’s initializer creates these objects and stores them in its properties.
The app creates an instance of this class, passing传入 in the Metal device object to use to create the secondary objects. The MetalAdder object keeps strong references to the Metal objects until it finishes executing.

MetalAdder* adder = [[MetalAdder alloc] initWithDevice:device];

In Metal, expensive昂贵的、消耗资源的 initialization tasks can be run once and the results retained and used inexpensively经济的.
You rarely极少地 need to run such tasks in performance-sensitive性能敏感的 code.

Get a Reference to the Metal Function

The first thing the initializer does is load the function and prepare it to run on the GPU.
When you build the app, Xcode compiles the add_arrays function and adds it to a default Metal library that it embeds in the app.
You use MTLLibrary and MTLFunction objects to get information about Metal libraries and the functions contained in them.
To get an object representing the add_arrays function, ask the [MTLDevice][MTLDevice] to create a [MTLLibrary][MTLLibrary] object for the default library, and then ask the library for a [MTLFunction][MTLFunction] object that represents the shader function.

- (instancetype) initWithDevice: (id<MTLDevice>) device
{
    self = [super init];
    if (self)
    {
        _mDevice = device;

        NSError* error = nil;

        // Load the shader files with a .metal file extension in the project

        id<MTLLibrary> defaultLibrary = [_mDevice newDefaultLibrary];
        if (defaultLibrary == nil)
        {
            NSLog(@"Failed to find the default library.");
            return nil;
        }

        id<MTLFunction> addFunction = [defaultLibrary newFunctionWithName:@"add_arrays"];
        if (addFunction == nil)
        {
            NSLog(@"Failed to find the adder function.");
            return nil;
        }

Prepare a Metal Pipeline

The function object is a proxy代理 for the MSL function, but it’s not executable code.
You convert the function into executable code by creating a pipeline.
A pipeline specifies the steps that the GPU performs to complete a specific task.
In Metal, a pipeline is represented描述 by a pipeline state object.
Because this sample uses a compute function, the app creates a [MTLComputePipelineState][MTLComputePipelineState] object.

_mAddFunctionPSO = [_mDevice newComputePipelineStateWithFunction: addFunction error:&error];

A compute pipeline runs a single compute function, optionally manipulating操作 the input data before running the function, and the output data afterwards.

When you create a pipeline state object, the device object finishes compiling the function for this specific GPU.
This sample creates the pipeline state object synchronously and returns it directly to the app.
Because compiling does take a while, avoid creating pipeline state objects synchronously同步的 in performance-sensitive code.

  • Note: All of the objects returned by Metal in the code you’ve seen so far are returned as objects that conform to protocols.
    Metal defines most GPU-specific objects using protocols to abstract away the underlying implementation classes, which may vary for different GPUs.
    Metal defines GPU-independent objects using classes.
    The reference documentation for any given Metal protocol make it clear whether you can implement that protocol in your app.

Create a Command Queue

To send work to the GPU, you need a command queue. Metal uses command queues to schedule commands.
Create a command queue by asking the [MTLDevice][MTLDevice] for one.

_mCommandQueue = [_mDevice newCommandQueue];

Create Data Buffers and Load Data

After initializing the basic Metal objects, you load data for the GPU to execute. This task is less performance critical临界的, but still useful to do early in your app’s launch.

A GPU can have its own dedicated专用的 memory, or it can share memory with the operating system.
Metal and the operating system kernel need to perform additional work to let you store data in memory and make that data available to the GPU.
Metal abstracts this memory management using resource objects. ([MTLResource][MTLResource]).
A resource is an allocation of memory that the GPU can access when running commands.
Use a [MTLDevice][MTLDevice] to create resources for its GPU.

The sample app creates three buffers and fills the first two with random data.
The third buffer is where add_arrays will store its results.

_mBufferA = [_mDevice newBufferWithLength:bufferSize options:MTLResourceStorageModeShared];
_mBufferB = [_mDevice newBufferWithLength:bufferSize options:MTLResourceStorageModeShared];
_mBufferResult = [_mDevice newBufferWithLength:bufferSize options:MTLResourceStorageModeShared];

[self generateRandomFloatData:_mBufferA];
[self generateRandomFloatData:_mBufferB];

The resources in this sample are ([MTLBuffer][MTLBuffer]) objects, which are allocations of memory without a predefined预定义的 format.
Metal manages each buffer as an opaque不透明的 collection of bytes.
However, you specify the format when you use a buffer in a shader.
This means that your shaders and your app need to agree约定 on the format of any data being passed back and forth来回的.

When you allocate a buffer, you provide a storage mode to determine some of its performance characteristics and whether the CPU or GPU can access it.
The sample app uses shared memory ([MTLResourceStorageModeShared][MTLResourceStorageModeShared]), which both the CPU and GPU can access.

To fill a buffer with random data, the app gets a pointer to the buffer’s memory and writes data to it on the CPU. The add_arrays function in Listing 2 declared its arguments as arrays of floating-point numbers, so you provide buffers in the same format:

- (void) generateRandomFloatData: (id<MTLBuffer>) buffer
{
    float* dataPtr = buffer.contents;

    for (unsigned long index = 0; index < arrayLength; index++)
    {
        dataPtr[index] = (float)rand()/(float)(RAND_MAX);
    }
}

Create a Command Buffer

Ask the command queue to create a command buffer.

id<MTLCommandBuffer> commandBuffer = [_mCommandQueue commandBuffer];

Create a Command Encoder编码器

To write commands into a command buffer, you use a command encoder for the specific kind of commands you want to code.
This sample creates a compute command encoder, which encodes a compute pass.
A compute pass holds a list of commands that execute compute pipelines.本例建立了一个能编码一个计算通道的计算命令编码器。
Each compute command causes the GPU to create a grid of threads to execute on the GPU.

id<MTLComputeCommandEncoder> computeEncoder = [commandBuffer computeCommandEncoder];

To encode a command, you make a series of method calls on the encoder.
Some methods set state information, like the pipeline state object (PSO) or the arguments to be passed to the pipeline.
After you make those state changes, you encode a command to execute the pipeline.
The encoder writes all of the state changes and command parameters into the command buffer.

s上图
上图仅仅说明了一件事,就是中间黑色的命令编码器可以把4中不同类型的数据都编码到命令缓冲中去。

Set Pipeline State and Argument Data

Set the pipeline state object of the pipeline you want the command to execute.
Then set data for any arguments that the pipeline needs to send into the add_arrays function.
For this pipeline, that means providing references to three buffers.
Metal automatically assigns indices索引(index的复数) for the buffer arguments in the order that the arguments appear in the function declaration in Listing 2, starting with 0.
You provide arguments using the same indices.
Metal按照List2例子中申明函数参数的顺序自动分配索引给缓冲参数,下面的atIndex。

[computeEncoder setComputePipelineState:_mAddFunctionPSO];
[computeEncoder setBuffer:_mBufferA offset:0 atIndex:0];
[computeEncoder setBuffer:_mBufferB offset:0 atIndex:1];
[computeEncoder setBuffer:_mBufferResult offset:0 atIndex:2];

You also specify an offset for each argument.
An offset of 0 means the command will access the data from the beginning of a buffer.
However, you could use one buffer to store multiple arguments, specifying an offset for each argument.

You don’t specify any data for the index argument because the add_arrays function defined its values as being provided by the GPU.

Specify Thread Count and Organization

Next, decide how many threads to create and how to organize those threads.
Metal can create 1D, 2D, or 3D grids.
The add_arrays function uses a 1D array, so the sample creates a 1D grid of size (dataSize x 1 x 1), from which Metal generates indices between 0 and dataSize-1.

MTLSize gridSize = MTLSizeMake(arrayLength, 1, 1);

Specify Threadgroup Size

Metal subdivides the grid into smaller grids called threadgroups线程分组.
Each threadgroup is calculated separately分离的.
Metal can dispatch threadgroups to different processing elements on the GPU to speed up processing.
You also need to decide how large to make the threadgroups for your command.

NSUInteger threadGroupSize = _mAddFunctionPSO.maxTotalThreadsPerThreadgroup;
if (threadGroupSize > arrayLength)
{
    threadGroupSize = arrayLength;
}
MTLSize threadgroupSize = MTLSizeMake(threadGroupSize, 1, 1);

The app asks the pipeline state object for the largest possible threadgroup and shrinks缩小 it if that size is larger than the size of the data set.
The [maxTotalThreadsPerThreadgroup][maxTotalThreadsPerThreadgroup] property gives the maximum number of threads allowed in the threadgroup, which varies depending on the complexity of the function used to create the pipeline state object.

Encode the Compute Command to Execute the Threads

Finally, encode the command to dispatch the grid of threads.

[computeEncoder dispatchThreads:gridSize
          threadsPerThreadgroup:threadgroupSize];

When the GPU executes this command, it uses the state you previously set and the command’s parameters to dispatch threads to perform the computation.

You can follow the same steps using the encoder to encode multiple compute commands into the compute pass without performing any redundant多余的 steps.
For example, you might set the pipeline state object once, and then set arguments and encode a command for each collection of buffers to process.

End the Compute Pass

When you have no more commands to add to the compute pass, you end the encoding process to close out the compute pass.

[computeEncoder endEncoding];

Commit the Command Buffer to Execute Its Commands

Run the commands in the command buffer by committing the command buffer to the queue.

[commandBuffer commit];

The command queue created the command buffer, so committing the buffer always places it on that queue.
After you commit the command buffer, Metal asynchronously异步的 prepares the commands for execution and then schedules the command buffer to execute on the GPU.
After the GPU executes all the commands in the command buffer, Metal marks the command buffer as complete.

Wait for the Calculation to Complete

Your app can do other work while the GPU is processing your commands.
This sample doesn’t need to do any additional work, so it simply waits until the command buffer is complete.

[commandBuffer waitUntilCompleted];

Alternatively要不, to be notified when Metal has processed all of the commands, add a completion handler to the command buffer ([addCompletedHandler][addCompletedHandler]), or check the status of a command buffer by reading its [status][status] property.

Read the Results From the Buffer

After the command buffer completes, the GPU’s calculations are stored in the output buffer and Metal performs any necessary steps to make sure the CPU can see them.
In a real app, you would read the results from the buffer and do something with them, such as displaying the results onscreen or writing them to a file.
Because the calculations are only used to illustrate the process of creating a Metal app, the sample reads the values stored in the output buffer and tests to make sure the CPU and the GPU calculated the same results.

- (void) verifyResults
{
    float* a = _mBufferA.contents;
    float* b = _mBufferB.contents;
    float* result = _mBufferResult.contents;

    for (unsigned long index = 0; index < arrayLength; index++)
    {
        if (result[index] != (a[index] + b[index]))
        {
            printf("Compute ERROR: index=%lu result=%g vs %g=a+b\n",
                   index, result[index], a[index] + b[index]);
            assert(result[index] == (a[index] + b[index]));
        }
    }
    printf("Compute results as expected\n");
}

Performing Calculations on a GPU结束。
该实例可以从苹果网站下载,直接在XCode中执行。如果您在运行中遭遇到签名问题,请直接把签名修改为“Sign to Run Locally”即可。

Performing Calculations on a GPU .zip 《Performing Calculations on a GPU 在显卡上进行计算》一文对应的程序,已经经过优化可以直接在Mac上运行,运行环境设为MacOS。 立即下载

相关推荐

Isaac Gym环境安装和四足机器人模型的训练

该方法提出一种训练模式,该模式通过在单个GPU工作站上使用大规模并行的方法来实现现实世界机器人任务的快速控制策略的生成。

weixin_44061195的博客 3万+

为什么我们仍然使用CPU而不是GPU?

oc使用cpu还是gpuIncreasingly GPUs are being used for non-graphical tasks like risk computations, fluid dynamics calculations, and seismic analysis. What’s to stop us from adopting GPU-driven devices? GPU...

1274

Claude Code VSCode集成开发指南:AI编程助手完整配置

Claude Code与Visual Studio Code的深度集成为开发者提供了强大的AI编程支持。本文详细介绍Claude Code VSCode扩展的安装配置、功能特性和实际应用方法。通过完整的配置流程和代码示例,帮助开发者充分利用Claude AI的智能编程能力。文章涵盖从环境搭建到高级功能应用的完整指南,包括代码自动补全、智能重构、实时代码分析等核心功能的使用技巧,以及与现有开发工作流的整合方案。

2501_93058131的博客 5985

记录GeForce RTX 2080 GPU安装遇到的问题及解决方案

在conda安装完成cuda、cudnn、tensorflow-gpu之后,运行测试代码,出现: NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running. 问题可以看出...

iamjingong的博客 3689

Unity地形优化实战:LOD、合批与HLOD打造流畅开放世界

在计算机图形学与游戏开发中,渲染优化是保障应用流畅运行的核心技术。其基本原理在于通过算法与策略,在视觉保真度与硬件资源消耗之间寻求最佳平衡,旨在提升帧率、降低功耗。这一技术的核心价值在于,它直接决定了大规模场景(如开放世界游戏)在性能受限平台(尤其是移动设备)上的可行性。具体到地形渲染这一关键应用场景,开发者需要综合运用多层次细节(LOD)技术来动态调整模型精度,并通过Draw Call合批(Batching)与GPU实例化(GPU Instancing)来大幅减少CPU到GPU的通信开销。对于超大规模世界

weixin_28077113的博客 333

捷联惯导总结--初始对准,位置标定,INS姿态更新,GPS/INS组合

惯导及组合导航回顾  2018.09.16 今天和17系的同学一起把惯导的流程捋了一遍,为了加深自己的记忆,这里在前面把心得大致列出来。 我们这里只考虑捷联式惯导及松组合 首先拿到惯性传感器(加速度计和陀螺仪)需要对其进行标定,是为了求出零偏,比例因子,交轴耦合这些误差。这些误差有的虽然在出厂时会给出,但是考虑到实际环境不同,还是要做标定。一般采用的是六位置旋转法,针对加速度计和陀螺仪同时...

赤豆几维 5万+

paper

1. learning from mistakes--a comprehensive study on real world concurrency bug characteristics.(asplos2008)       主要介绍了分析了多线程、多进程开发时,可能碰到的错误。作者对openoffice,firefox, apache,mysql的代码错误进行了分析,总结并行开发中错误。

yazhouren的专栏 813

速腾16线激光雷达(RS-16)在ubuntu18.04系统下跑SC-A-LOAM算法

说明: 简要记录一下速腾16线激光雷达即RS-16在ubuntu18.04系统下跑SC-A-LOAM算法的过程,因为SC-A-LOAM算法源码不支持RS雷达的数据,大致思想就是先将rs雷达发布的激光数据转换为velodyne类型的数据,考虑到接下来还要基于RS-16实时运行SC-A-LOAM算法,这里提前将RS_SDK驱动安装好。 1 搭建SC-A-LOAM算法运行环境 首先需要在电脑上搭建SC-A-LOAM算法的运行环境,见文章《ubuntu18.04搭建SC-A-LOAM环境并运行》 本文所使用的系统架

超爱吃小蛋糕的66的博客 2373

基于Ubuntu16.04的GeForce GTX 1080驱动安装,遇到的问题及对应的解决方法

1.在主机上插上GPU之后,查看设备: $ nvidia-smi Tue Dec 5 10:36:43 2017 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 375.66 Driver Versio...

weixin_30342827的博客 596

上位机 寻边器 通讯实战

寻边器通讯接口实现 本文介绍了上位机与盖泽(Gazer)和JEL品牌寻边器的通讯接口实现方案。主要内容包括: 接口定义:创建了IAlignerOperation接口,定义了获取状态、控制运动、真空吸附等核心功能。 具体实现: 盖泽寻边器(GazerAlignerCjh):通过串口通讯,实现了回零、校准、移动位置等操作 JEL寻边器(JelAligner):同样基于串口通讯,包含错误处理、状态查询等功能 工厂模式:通过AlignerFactory工厂类根据设备品牌创建对应的实现对象。 设备加载:展示了如何在系

StevenChen的博客 378

【PINN物理信息网络】基于PINN物理信息网络求解泊松方程(python)

【PINN物理信息网络】基于PINN物理信息网络求解泊松方程(python)

k8291121的博客 2812

从Prompt工程到生产级AI智能体:系统化学习路线与架构设计指南

Prompt工程是构建AI应用的基础,它通过结构化指令引导大模型完成特定任务。其核心原理在于将自然语言指令转化为模型可理解、可执行的格式,涉及零样本学习、思维链推理等关键技术。掌握Prompt工程能显著提升模型输出的准确性和可控性,为开发智能对话系统、自动化工具等场景奠定基础。在此基础上,AI智能体架构通过整合规划、工具调用、记忆管理等模块,实现了对复杂任务的分解与执行。本文聚焦于如何将Prompt工程与智能体架构相结合,提供从入门到生产部署的完整学习路径,涵盖LangChain框架应用、工程化考量及性能优

weixin_34315485的博客 334

运放单电源供电和双电源供电的实际应用案例

文章摘要:本文对比分析了运放单电源与双电源供电的典型应用场景及电路设计要点。单电源供电适用于低成本、小体积设备,如便携音箱(5V供电+中点偏置)、工业4-20mA信号转换(12V供电+电压跟随)和物联网传感器(3.3V低功耗设计);双电源供电则适合高精度要求场景,如Hi-Fi音响(±15V对称输出)、医疗设备(±5V微弱信号放大)和精密仪器(±15V宽动态范围)。文末提供常见运放选型对照表,涵盖LM324、TL082等型号的供电参数与核心特性,为不同应用场景提供选型参考。(149字)

qq_37999850的博客 610

基于贾子理论与THL-5真理硬度标准的概率拟合大模型结构性破产必然性研究

摘要 本研究基于贾子理论与THL-5真理硬度标准,对概率拟合大模型的结构性破产必然性进行了深入分析。当前以Transformer架构和自回归令牌概率预测为核心的概率拟合大模型,通过海量数据统计关联分析生成内容,而非基于公理体系的因果逻辑推演。研究发现,该技术路径的边际效益正快速衰减:算力、数据和模型规模呈指数级扩张,但实际性能提升有限,投入产出比严重失衡。 通过全球头部企业财报和行业实测数据,本文从技术逻辑、成本结构和商业变现等维度证明:概率拟合大模型存在成本指数增长与营收线性增长的不可逆矛盾,企业净现金流

首席技术执行官CTO(Chief Technology Officer)|技术总监--邓斌博客 1341

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

AI Agent核心技术栈全解析:从ReAct到多智能体协作实战

在人工智能领域,智能体(Agent)技术正成为连接大语言模型与实际应用的关键桥梁。其核心原理在于构建具备自主规划、工具调用与环境交互能力的系统,通过“思考-行动-观察”的循环范式实现复杂任务处理。从技术价值看,AI Agent能够将静态的AI能力转化为动态的问题解决流程,显著提升自动化水平。在应用场景上,它已从简单的聊天机器人扩展到自动化办公、商业智能分析、个性化服务等多个领域。本文聚焦于AI Agent的两大核心实现范式:ReAct(推理与行动)与Multi-Agent(多智能体协作),通过LangCha

weixin_30394981的博客 401

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Ubuntu 16.04 源码编译安装GPU tensorflow(二)

如前一篇在1.4.0版本的Tensorflow上安裝Tensorflow Object Detection API,在验证测试时出現serialized_options=None问题。需安装高版本Tensorflow。到目前,最新的Tensorflow是1.10.0版本,虽想尝个鲜,但怕坑太多。下面还是安装1.8版本。 特别注意:请各位看官务必看完全文再参考,本文未经最后整理,基本是安装过程记录...

pkokocl的博客 4379

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

再看CNN中的卷积

这两天在看CS231n的课程笔记,结合着原版英文和知乎上中文版翻译在看,确实Andrej Karpathy写的很棒,很多都是些实践经验不仅仅是理论知识. 我结合着自己的理解和Karpathy的介绍,重新看确实又收获了不少,以前觉得不明白的地方现在也清晰了,所以重新写这个重看篇,仅供参考CNN的组成 convolution layer pooling layer

GavinZhou的博客 7677

小白一键部署:VoiceStudio 本地语音工作室(Linux/Win/Mac)

VoiceStudio 是破十万星的开源本地语音工作室。本文在 Debian 13 实机用官方一行命令装上 0.5.7,记录 GPU 崩溃启动参数、Install local runtime、模型许可,以及 CPU 上 Voice Design 合成 7 秒 demo。与只做听写的 Hex 互补。

m0_56699208的博客 167

OpenClaw Mac mini部署教程:接入飞书、AI Agent与公网访问

OpenClaw Mac mini部署教程:接入飞书、AI Agent与公网访问

wei_shuo的博客 1万+

WebStorm macOS 安装调优与实战效果全景

本文以实测视角展示 WebStorm 2025.3 在 macOS 上的极致体验:原生 arm64 启动仅需 3–5 秒,Islands 主题显著提升标签页辨识度,AI 全行补全精准响应,正确排除 node_modules 后索引时间压缩至 30 秒内,重命名重构时静态引用清晰呈现。通过真实项目流程验证其在 React + TypeScript、Vue 3 + Vite 中的高效开发闭环。文末明确适用边界——适合中大型项目与深度开发者,对轻量级或简单脚本场景优势有限。

独坐一隅,凝神遐想,是种幸福! —— 独隅 42

Mac 和 Windows 虚拟机怎么共享文件?用 UVM 设个共享文件夹

在 UVM 选择 Mac 共享文件夹,从 Windows 的「此电脑」打开共享盘,验证双向读写。文末附 UVM 简介与官方下载入口。

hsduren的专栏 137

组网第64课:802.1X 与准入——三角色、Guest VLAN、MAC 认证、哑终端准入

2021 年一个制造客户,接入层四十多台交换机,端口全是默认开放。会议室墙上留了四个网口给投影和视频会议,平时没人管。某天流量监控报警:办公网里有台设备在扫 ,一小时扫了三百多个地址。顺着 ARP 表往上找,端口在会议室,MAC 不在资产台账里。到现场一看,一台不属于公司的笔记本插在墙插上,外包人员来开会顺手插的,插上就拿到了办公网 IP,直接能访问文件服务器。IT 负责人跟我说了句大实话:“我们没做过准入,端口插上就能用。”这就是准入要解决的问题。不是"防黑客"这种空话,是很具体的三件事:谁能接进来、接进

qq_36765170的博客 268

26. iMac与Mac屏幕同步休眠 ❀ 老梅子学AI

Luna Display 确实实现了iMac作为Mac副屏的功能,显示清晰度也很满意,网线连接时反应速度也很理想,但是发现了一个新问题,那就是Mac经过一段时间未操作屏幕休眠了,但iMac屏幕却一直是亮着的,怎样才能让iMac屏幕随着Mac屏幕一同休眠呢?

防火墙技术专栏 218

WebStorm macOS 安装部署与高效调优完全指南

本文为 WebStorm 2025.3/2026.1 在 macOS 上的安装与调优指南,针对零基础开发者,涵盖系统检查、dmg 安装、首次配置、快捷键迁移、Node.js 环境关联、调试实操及性能优化。重点澄清“右键排除 node_modules 无效”“nvm 用户需手动指定路径”等常见误区,提供内存调优、索引排除、插件精简等实战技巧,助用户构建高效稳定的前端开发环境。附常见报错排查表与资源链接,可快速上手并持续优化。

独坐一隅,凝神遐想,是种幸福! —— 独隅 415

WebStorm macOS 深度评测:安装实测、性能调优与实战边界

WebStorm 2025.3 在 macOS Apple Silicon 上表现卓越,原生 arm64 版启动快、索引效率高,M1 Pro/16GB 环境下中型项目首次分析仅需 52–68 秒,内存稳定在 900MB–1.3GB。实测显示,排除 node_modules 及启用共享索引可显著提速,但 8GB 内存设备运行仍显吃力。插件兼容性与启动稳定性存在个别问题,建议用户优先使用 Toolbox 管理并手动配置 Node.js 路径。综合来看,该版本适合中大型 TypeScript 项目开发,是高性能需

独坐一隅,凝神遐想,是种幸福! —— 独隅 584

电脑自带录屏功能怎么带声音?Windows 与 Mac 完整设置指南

Windows 用户优先用 Xbox Game Bar 或 Windows 11 截图工具,在音频面板里同时打开系统声音和麦克风即可;Mac 用户用 QuickTime 或 Shift + Command + 5 可以轻松录到人声,但要录系统内部声音需要额外配置虚拟音频设备,或者安装专业录屏软件。记住「系统声音」和「麦克风声音」是两套独立开关,分别确认,基本就能解决绝大多数录屏无声的问题。

xiaolu12388的博客 109
上一篇: QT通过起点、终点、弧度(方向)来绘制圆弧
下一篇: Using Metal to Draw a View‘s Contents用Metal绘制视图内容
oop4587
博客等级 码龄25年 19粉丝 26原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值